[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ONELINER TEXTADVENTURE



Chris Cowley <forename.surname@invalid.grok.co.uk> wrote in message news:<18p5e09cr8jkifnpp6c8717m65rm0ep08j@4ax.com>...
> On Wed, 30 Jun 2004 15:49:28 GMT, "Peter Watson"
> <paw77@N_O_hotmail_S_P_A_M.com> wrote:
> 
> >I don't recognise the BASIC - what machine is it written for? Also, am I
> >right in saying that it is self-modifying code?
> 
> It's Sinclair BASIC (http://www.worldofspectrum.org/sinclairbasic/), for
> the Sinclair ZX Spectrum (USA: Timex-Sinclair 2068) and no, it isn't
> self-modifying.
> 
> The most significant "unusual" thing about the BASIC syntax is that,
> instead of MID$,LEFT$ and RIGHT$, you would use A$(x TO y), A$( TO x),
> or A$(x TO ) where x and y are character positions within A$.
> 
> [Followups set to comp.sys.sinclair]


The INPUT R$(9) is there to prevent an empty string being INPUTed.
With DIM R$(10,4) Sinclair BASIC defines always an array of 4 bytes
for every array entry, so even if you type nothing in the INPUT the
length of R$(9) will be 4 bytes and making it possible to test the
first left byte of R$(9) by
reading it (i.e LET A$=R$(9,1) )