Author Topic: WHILE or DO?  (Read 130 times)

Offline Prithak

  • Just a random Coder from Nepal
WHILE or DO?
« on: November 12, 2018, 02:17:00 PM »
I really wanted to ask this question...

For optimization, is:

Code: [Select]
CLS
DO
DO WHILE _MOUSEINPUT
'DO Something
LOOP
LOOP
END

or,
Code: [Select]
CLS
DO
WHILE _MOUSEINPUT
'DO SOMETHING
WEND
LOOP

???, I am guessing the while wend one...
If computer = "on" then
me$ = "Happy"
else
me$ = "Meh"
end if

Offline FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: WHILE or DO?
« Reply #1 on: November 12, 2018, 04:31:20 PM »
There's basically no difference internally. You can choose whichever you feel looks better.

Offline Prithak

  • Just a random Coder from Nepal
Re: WHILE or DO?
« Reply #2 on: November 13, 2018, 03:54:31 AM »
There's basically no difference internally. You can choose whichever you feel looks better.
Thanks for the help!
If computer = "on" then
me$ = "Happy"
else
me$ = "Meh"
end if