Commodore 128 Alive!

Commodore PET => Commodore PET => PET tips & tricks => Topic started by: Blacklord on July 28, 2009, 07:31 AM

Title: On-line Remarks
Post by: Blacklord on July 28, 2009, 07:31 AM
With a PET, on-line remarks are made as follows, according to Commodore.

200   GOSUB 500 : REM OUTPUT

Both the statement-delimiting colon and the REM statement must precede the remark. Other implementations of BASIC allow the use of an apostrophe in the place of both of these, making programs more readable.

200:   GOSUB 500   'OUTPUT

The PET actually allows the construction just given! However, the PET does not use the apostrophe as an abbreviation for REM. In fact, the PET allows the following construction.

200: GOSUB 500 OUTPUT

Nonnumeric character strings that follow the target line number of a GOTO, GOSUB, or THEN statement are ignored. This is not true for all other kinds of statements. Nonetheless, it is convenient to be able to tag GOSUB statements with labels reminding the reader of the nature of the target subroutine.
EhPortal 1.34 © 2025, WebDev