DAY 011: REM
#6
(11-16-2022, 06:04 PM)CharlieJV Wrote:
(11-16-2022, 04:43 PM)SMcNeill Wrote: ...snip...

I love this article.

I had never thought about it: REM is a statement.

I knew it subconsciously via the pain using it at the end of a line after code because of the needed separator (":").

But I had never thought about it in the use of an IF ... THEN REM scenario.  And I like it.  I can see times in which I'd want to make a "do nothing in this condition" very explicit, and I like this approach.  Totally floats my boat.

(Well, a "DO_NADA" statement would be more semantically jugular-grabbing, but REM is good enough.)

Thanks !

Glad to see people reading these and learning from them.  Wink

That last line of yours made me laugh out loud -- at myself!   Believe it, or not, you'll find the following in a good bit of my personal code:

Code: (Select All)
SUB DoNothingAtAll
END SUB

The main reason I tend to have such a sub in a ton of my code??  For use with _RESIZE.

_RESIZE returns a value for us so we can make adjustments in our program when the user changes the size of the window.  Only problem is, it reports ALL changes to the window size.   QB64 tends to start, by default, with a SCREEN 0 text screen.  So, naturally, once we place a statement like SCREEN _NEWIMAGE(800,600,32) in our code, it has to change size, triggering that _RESIZE flag...

And so, you'll see me with a lot of this type of code in my programs:

Code: (Select All)
SCREEN _NEWIMAGE(800, 600, 32)
IF _RESIZE THEN DoNothingAtAll

It's not a DO_NADA, but it's mighty dang close!!
Reply


Messages In This Thread
DAY 011: REM - by SMcNeill - 11-16-2022, 04:43 PM
RE: DAY 011: REM - by bplus - 11-16-2022, 05:25 PM
RE: DAY 011: REM - by SMcNeill - 11-16-2022, 05:48 PM
RE: DAY 011: REM - by CharlieJV - 11-16-2022, 06:04 PM
RE: DAY 011: REM - by SMcNeill - 11-16-2022, 06:21 PM
RE: DAY 011: REM - by mnrvovrfc - 11-16-2022, 06:20 PM
RE: DAY 011: REM - by TerryRitchie - 11-16-2022, 07:06 PM
RE: DAY 011: REM - by SMcNeill - 11-16-2022, 07:29 PM
RE: DAY 011: REM - by TerryRitchie - 11-16-2022, 07:47 PM
RE: DAY 011: REM - by SMcNeill - 11-16-2022, 08:44 PM
RE: DAY 011: REM - by CharlieJV - 11-16-2022, 10:00 PM
RE: DAY 011: REM - by bplus - 11-16-2022, 08:27 PM
RE: DAY 011: REM - by Pete - 11-16-2022, 08:32 PM
RE: DAY 011: REM - by Jack - 11-16-2022, 08:37 PM
RE: DAY 011: REM - by Pete - 11-16-2022, 09:20 PM
RE: DAY 011: REM - by mnrvovrfc - 11-16-2022, 10:22 PM
RE: DAY 011: REM - by Dav - 11-16-2022, 10:03 PM
RE: DAY 011: REM - by CharlieJV - 11-16-2022, 10:13 PM
RE: DAY 011: REM - by Pete - 11-16-2022, 10:17 PM
RE: DAY 011: REM - by Pete - 11-16-2022, 11:04 PM
RE: DAY 011: REM - by SMcNeill - 11-16-2022, 11:13 PM
RE: DAY 011: REM - by Pete - 11-16-2022, 11:53 PM
RE: DAY 011: REM - by Dav - 11-17-2022, 12:45 AM
RE: DAY 011: REM - by CharlieJV - 11-17-2022, 01:01 AM
RE: DAY 011: REM - by mnrvovrfc - 11-17-2022, 01:20 AM
RE: DAY 011: REM - by SMcNeill - 11-17-2022, 12:59 AM
RE: DAY 011: REM - by Pete - 11-17-2022, 01:04 AM
RE: DAY 011: REM - by TerryRitchie - 11-17-2022, 02:02 AM
RE: DAY 011: REM - by Dav - 11-17-2022, 01:18 AM
RE: DAY 011: REM - by Pete - 11-17-2022, 01:23 AM
RE: DAY 011: REM - by Pete - 11-17-2022, 02:25 AM
RE: DAY 011: REM - by mnrvovrfc - 11-17-2022, 07:55 PM
RE: DAY 011: REM - by Pete - 11-17-2022, 08:26 PM
RE: DAY 011: REM - by bplus - 11-17-2022, 09:39 PM



Users browsing this thread: 12 Guest(s)