[Solved] What is the purpose of a do-while loop? [duplicate]

Consider the following: while(condition){ myFunction(); } and do{ myFunction(); }while(condition); The second form executes myFunction() at least once then checks the condition! To do so with a while loop you’ve to write: myFunction(); while(condition){ myFunction(); } solved What is the purpose of a do-while loop? [duplicate]

[Solved] I am trying to design a program that compares two strings for the same character in the same positions but same error keeps popping up

I did it!!!! public static boolean sameDashes(String a, String b){ int minlength = Math.min(a.length(), b.length()); String smallstring=””; String bigstring=””; if(a.length()== minlength){ smallstring = a; bigstring = b; } else { smallstring = b; bigstring =a; } int counter = 0; int x=0; int y=0; do{ if(smallstring.equals(bigstring)){ return true; } else if(smallstring.indexOf(‘-‘,counter)!= -1){ y++; if(bigstring.charAt(smallstring.indexOf(‘-‘,counter))== ‘-‘){ … Read more

[Solved] Do While Loop for SKU numbers

No need to use the Do Loop. Find the last row and then use a For loop. Is this what you are trying? Sub Sample() Dim ws As Worksheet Dim lRow As Long, i As Long ‘~~> Change this to the relevant sheet Set ws = ThisWorkbook.Sheets(“Sheet2”) With ws ‘~~> Find last row lRow = … Read more