<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 28 Jun 2005 01:26:25 +0200
From   : John Kortink <kortink@...>
Subject: Re: BASIC IV: Coded Line Number

On Mon, 27 Jun 2005 16:53:11 +0100, Richard_Talbot-Watkins wrote:

>[...]
>
>When run with A%=0, the message '<139>Works' is printed
>as expected. When run with A%=1, we get the less useful
>'Mistake at line 10'. The interpreter is failing to notice
>that the ELSE token (139) is within quotes and should
>therefore be scanned past.  This is a BUG!  (bit unfair
>admittedly)
>
>A truly evil way to obfuscate a Basic program would be to
>actually put valid interpretable code inside that string
>after the <139>, ending it with:<244> (the token for REM,
>to tell it to skip the rest of the line, or that closing
>quote would be a syntax error).  I've just tried this in
>Basic II and it works perfectly, much to my horror!
>
>[...]

I'd disagree about the word 'bug'. Although it may not
be stated explicitly anywhere in the BASIC docs, you're
expected to use e.g. CHR$(139) to get any top-bit-set
characters into string literals, not 'lure' them between
quotes either by poking (yuck) or COPY-ing them off the
screen after displaying them.


John Kortink

-- 

Email    : kortink@...         
Homepage : http://www.inter.nl.net/users/J.Kortink
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>