On 08/04/2022 14:56, Tobias Fröschle via Ql-Users wrote:
The main reason, I believe, is that INSTR_CASE is a global setting and so
shouldnt be set by a program, but only by the user in the main console
That's actually not the problem: INSTR_CASE seems to work "local" to each
instance of the SBASIC interpreter (I just checked).
Youre right, of course. I dont know where I got that idea. I thought
Id read it somewhere long ago. The stupid thing is that I did some
half-hearted tests myself before I posted but my results were
inconclusive, so I ignored them. Also there is a lack of detail in the
documentation (eg the online Reference Manual) It seems to me that
this is important information, especially since (perhaps) at some time
this may have been documented as a global setting.
Turbo happily compiles programs that contain INSTR_CASE statements, but does
seem to be using its own INSTR implementation (that will, obviously, not switch
according to INSTR_CASE). So, compiled programs simply don't react on the
INSTR_CASE settings. QLiberator does exactly the same.
Yes, it doesnt work in Turbo nor in Qlib, as I stated. In up to date
versions of Qlib you also get a warning message. It is possible that
it might not be too hard to fix, if anyone wants to have a go. But any
compiled program using it would still only work under SMSQ/E. INSTR is
part of the S*BASIC language and couldnt be altered in Qdos without
creating a new ROM. A workaround might be to add internal INSTR code
to Qlib and Turbo, that is aware of the INSTR_CASE setting, but that
seems to me to be a lot of code and trouble for a rare and minor
issue. Just use INSTR% instead!
Per
_______________________________________________
QL-Users Mailing List