DO...WHILE/UNTIL Loops???

OLDmarty

Senior Member
Hi All,

I've been adding more do..loops into some code recently and wondered if there is an actual preference to use the WHILE or UNTIL options in a DO LOOP?

If i think about something simple like:
Code:
DO WHILE B0=0
Isn't this just the same thing?:
Code:
DO UNTIL B0>0
I guess it depends on what code and extra loop-counting is required to perform a certain task, but sometimes when i look at the do..loop description in the manual, most of it all looks to be doing the same thing.

Additionally, aren't DO WHILE/UNTIL and LOOP WHILE/UNTIL performing the same tasks to the code within the loop?
Maybe there is some mathematical advantage of placing the WHILE/UNTIL options either at the beginning DO command, or at the ending LOOP command, like if you need to use numbers from 0-7 instead of 1-8 or something similar?

Perhaps somebody can explain any advantages of using DO LOOPS one way instead of the other? or at least offer a clearer definition than what the manual does.

I understand the overall do..loop concept, but it seems (to me) there's some duplicated options under different names that puzzles me ;-)

thanks in advance.
 

inglewoodpete

Senior Member
There are subtle differences when you start using DO and LOOP in more complicated programs. The following two lines come from a programme that I have open in my PE at the moment:
Rich (BB code):
Do Until @Ptr = "*" Or bPktLen > 82
   -and-
Do Until Ptr = hSerPtr
The difference between having a DO <condition> and a LOOP <condition> is that the DO <contition> can cause the code in the loop to be bypassed (and not executed) while the LOOP <condition> requires the code within the DO/LOOP structure to be executed at least once.
 

erco

Senior Member
Since Picaxe is from the UK, shouldn't they be DO/WHILST loops?

Otherwise, it's an admission that Americans are right once again. :)
 

tmfkam

Senior Member
Since Picaxe is from the UK, shouldn't they be DO/WHILST loops?

Otherwise, it's an admission that Americans are right once again. :)
Good point!

Though I would argue that "Do...While" is referring to the present tense, "Whilst" would refer to the past tense. I would only use "Whilst" to refer to the (long) past tense, so perhaps "While" should stay?

(UK) English is a minefield, so I don't doubt others could argue that I'm totally wrong. Much of the English written and spoken language relies on vague rules with very often multiple even less well formatted exceptions for those vague rules. I tend to stick to my own rules and brave it out. It worked for Shakespeare. Or Shakespear, or however he wrote his own name on any given day.
 

papaof2

Senior Member
English in any country is something of a mongrel, with England's sea-faring traders having acquired as many (or more) new words as they did new goods in their travels. But that also means learning English could be entitled "An Introduction to 80% of the World's Languages" ;-)

As a writer , I frequently find myself at odds with Microsoft Word, often saying "Stupid computer" or "Incompetent Programmer" or possibly "@#$%^&*!" when it suggests obviously incorrect phrasing, such as "You is" for "You're" - at which point I can only conclude that the programmer assigned responsibility for the dictionary and grammar was never the student of a good English teacher, regardless of her/his native language.
 
Last edited by a moderator:

lbenson

Senior Member
"You is" may be a Large Language Model AI finding this usage common on TicTok and elsewhere. Yesterday I ran across the usage of the term, "slop" to refer to plausible pap being generated by AI and filling our search returns. I'm seeing it more and more--I click on something and after about 2 sentences realize it's AI generated, and likely not to be informative about what I'm searching for.
 

papaof2

Senior Member
No, the "slop" of "You is" was in Word 2003, so well before AI. It's still in Word 2013 and I refuse to spend more money for another version that requires re-learning all the shortcuts I have muscle memory for after running a million words through Word 2003. I only went to a cheap copy of 2013 because Win 10 64bit wasn't happy with Word 2003. No, I don't plan to move up (more likely down) with Win 11. XP was the last Windows version which I considered mature and fully functional - it could find whichever wifi card was in my Dell laptop but Win 7 and up could not - the one that finds the hardware is mature. Having to run Belarc Advisor to determine the card Win 7 through Win 10 could not identify just confirms "not mature".
I'll still be using XP for some development because I'm not developing for anything that needs 64 bit and 32 bit XP fills those needs. I'll use 64 bit Win 10 to have a VPN for accessing the internet - when the VPN does NOT break it (neither Atlas nor Nord is totally transparent and both block known safe sites - but that's even further off topic here).
 

kfjl

Member
For those who don't know, Open Office and Libre Office work with Windows, Linux and Mac.
They're both free of charge. No keys, no activation, no licenses, no hassle, no Microsoft.
 

papaof2

Senior Member
Possibly a combination of e-waste computer licenses and partially used site licenses.

If you're very familiar with Word, most of the keyboard shortcuts in the free packages are similar and a few are identical. To avoid copyright problems, some of the most frequently used shortcuts are one character different from the Word shortcut. No problem if you start with one of the free office packages but a minor trip-up until you've memorized the key sequences Libre Office, for example, actually uses. I do have Libre Office on an older machine with Word 2003 and I did learn to switch between them - if this old dog (70+) can learn new tricks, so can you ;-)
 
Top