Code: Select all
LEFT$(a$,2) = "ab"
Code: Select all
LEFT$(a$,2) = "ab"
Nobody? Surely somebody can remember back to 1986 better than I can (that shouldn't be difficult)! Did Sinclair BASIC or Amstrad (Locomotive) BASIC perhaps support it? I've got the Locomotive BASIC manual and I can't find it there. I thought perhaps it was QBASIC, but it doesn't seem to work in that either. Yet I'm fairly certain it wasn't Sophie's invention.Hated Moron wrote: ↑Wed 16 Nov 2022, 18:22 what other BASICs support using the string-slicing functions (LEFT$, MID$, RIGHT$) as L-values?
Code: Select all
A$ = B$(X TO Y)
That's correct, but in so doing they were incredibly non-standard. It led to anomalies like the following:Phil_Thatcham wrote: ↑Sat 19 Nov 2022, 12:20 I'm pretty sure Sinclair's BASIC for the ZX80, ZX81 and SPECTRUM had none of the string functions listed. Instead, they sliced strings using an all-purpose TO
Code: Select all
DIM a$(10)
a$(5) = "x"
There is Paul Dunn's SpecBAS as I mentioned here only recently.I have no idea what happened to Sinclair BASIC after the SPECTRUM.
I included an example in the first post of this thread, which I thought would explain it to those (I would hope very few) not familiar with the terms l-value and r-value in the context of programming languages:I'm in one of my thick modes. Can you explain exactly what you mean by LEFT$ (etc) as L-value.
See also https://en.wikipedia.org/wiki/Value_(co ... d_r-valuesTo settle a question at another forum, what other BASICs support using the string-slicing functions (LEFT$, MID$, RIGHT$) as L-values?Code: Select all
LEFT$(a$,2) = "ab"
Ah, the rub is in the "e.g.". I tried LEFT$ in QBASIC and it doesn't work, so I concluded that it didn't support this feature, but having now tried it with MID$ it does! Maybe the same is true of the other BASICs.Phil_Thatcham wrote: ↑Sat 19 Nov 2022, 13:09 Found the BASIC manuals for Locomotive, Amstrad CPC6128 and QBASIC online. They all offer (e.g.) MID$() as both function and statement.
I think we have the answer. It's been confirmed that GW-BASIC supported it (MID$ only) and although that hadn't been released in 1986 Microsoft's BASICA was around, and that is substantially identical. Locomotive BASIC (Amstrad) also had it in 1984. So my recollection that it was already a feature supported by other BASICs in 1986 was correct.Hated Moron wrote: ↑Wed 16 Nov 2022, 18:22 When this feature was added in ARM BBC BASIC V (1986 or thereabouts) I'm sure it wasn't something dreamt up by Sophie, there were other BASICs of the era that supported it too.