Example:
10 LET z$="10101010"
20 PRINT VAL ("BIN "+z$)
In 48 basic, the BIN is enter-able as a keyword. I can't see a way for 128 basic to recognise BIN within quotes as anything other than "B" + "I" + "N". The result in 128 basic is the equivalent of typing 'B' 'I' 'N' in 48 basic: i.e. variable not found; rather than evaluating BIN z$.
Unsurprisingly, writing it in 128 basic and transferring the listing to 48 basic with 'spectrum' retains the 'B' 'I' 'N' as three separate characters - rather than then tokenising it.
Is there any way of entering line 20 in 128 basic and it working as intended? I can see that the single character entry wouldn't be able to parse it as a keyword if it can't be made aware that it's a keyword.
128 Basic and keywords within quotes
Re: 128 Basic and keywords within quotes
Double post deleted.
Last edited by SabreWulf on Fri Mar 10, 2023 3:32 pm, edited 1 time in total.
Re: 128 Basic and keywords within quotes
Answering my own question, a solution is:
20 PRINT VAL (CHR$ 196 + z$)
To save anyone looking that up, CHR$ 196 is, unsurprisingly, the BIN keyword.
I hadn't realised that 128 basic parsing would require workarounds like this. Anyway, onward and upward.
Any other solutions would still be appreciated.
20 PRINT VAL (CHR$ 196 + z$)
To save anyone looking that up, CHR$ 196 is, unsurprisingly, the BIN keyword.
I hadn't realised that 128 basic parsing would require workarounds like this. Anyway, onward and upward.
Any other solutions would still be appreciated.
- 1024MAK
- Posts: 4433
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: 128 Basic and keywords within quotes
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert! Spring approaching
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert! Spring approaching
