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

Offline Prithak

  • Make it work, make it right, make it fast.
    • The History Of Video Games(My Latest Website)
WHILE or DO?
« on: November 12, 2018, 11:17:00 AM »
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...
CLS
IF computer$ = "ON" THEN
me$ = "Happy!"
ELSE
me$ = "Time To Draw!"
END IF
END

Offline FellippeHeitor

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

Offline Prithak

  • Make it work, make it right, make it fast.
    • The History Of Video Games(My Latest Website)
Re: WHILE or DO?
« Reply #2 on: November 13, 2018, 12:54:31 AM »
There's basically no difference internally. You can choose whichever you feel looks better.
Thanks for the help!
CLS
IF computer$ = "ON" THEN
me$ = "Happy!"
ELSE
me$ = "Time To Draw!"
END IF
END