Actually, a While loop wouldn’t work here, because the condition is to be evaluated after the loop runs–While loops have to be tested before the loop. (This can be adjusted for by putting the commands both before and inside the loop, but that’s probably more trouble than it’s worth.)
A feature of the Do/Loop loop is that you can evaluate a condition at the start, end, both, or neither. This is distinguished from the While/Wend loop where the condition must be evaluated at the start.
All of these are valid:
do
SomeStatements()
loop // endless so use 'exit' or 'return' somewhere in the loop
do until someCondition // A reverse While/Wend
SomeStatements()
loop
do
SomeStatements()
loop until someCondition
do until someCondition
SomeStatements()
loop until someOtherCondition
may function differently in Xojo, because the default string comparison is not case sensitive. If you need case sensitive string comparison use StrComp.
Thanks for all the help. The loop until seems to work as expected for me in this case. For the UCase part I just used pTarget.Text.Uppercase and that seems to work.