BBC BASIC for Windows
Programming >> BBC BASIC language >> DATA REM statements
http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1413403744

DATA REM statements
Post by Matt on Oct 15th, 2014, 8:09pm

Hi,

I'm sure this has come up before, but I can't find reference to it. Why does the REM statement after a DATA line not appear in the REM colour? (If it explains it in the help, then I'm losing it big time.)

Matt
Re: DATA REM statements
Post by rtr2 on Oct 15th, 2014, 8:44pm

on Oct 15th, 2014, 8:09pm, Matt wrote:
Why does the REM statement after a DATA line not appear in the REM colour?

Because it isn't a REM! Run this program and all will be made clear:

Code:
      FOR I% = 1 TO 4
        READ A$
        PRINT A$
      NEXT

      DATA 1, 2 : REM
      DATA 3, 4 

The second data item is "2 : REM"!

Richard
Re: DATA REM statements
Post by Matt on Oct 16th, 2014, 05:32am

on Oct 15th, 2014, 8:44pm, g4bau wrote:
The second data item is "2 : REM"!

That's true. Yet it ignores it if you put the strings in quotes.
Code:
      FOR I% = 1 TO 4
        READ A$
        PRINT A$
      NEXT

      DATA "1", "2" : REM
      DATA "3", "4" 


Re: DATA REM statements
Post by rtr2 on Oct 16th, 2014, 07:11am

on Oct 16th, 2014, 05:32am, Matt wrote:
That's true. Yet it ignores it if you put the strings in quotes.

But it's still not a REM! Try this:

Code:
      FOR I% = 1 TO 4
        READ A$
        PRINT A$
      NEXT

      DATA "1", "2" : MATT
      DATA "3", "4" 

If in doubt, examine the .BBC file with a hex editor: REM is &F4 whereas REM is &52 &45 &4D

Richard.