Re: [Ql-Users] INSTR_CASE
Hi, > INSTR_CASE > SMSQE works as expected > but not as Qlib Job Without checking by actually tracing a call to INSTR from within a Qlib job, I believe that this probably is one incompatibility between SMSQE and QDOS/Qlib. To honour the INSTR_CASE, SMSQE checks a flag, namely the SBasic variable sb_cinst (=$b0) (see smsq_sbas_iexpr_asm, label b_instr) which is set by INSTR_CASE. However, in QDOS, the SuperBasic variable at $b0 is "bv_tkpos", which contains something else entirely, namely "Position of A4 in tklist on entry to PROC". If Qlib correctly mimicks SuperBasic, it probably overwrites the flag at $b0 with the correct value for Superbasic between the INSTR_CASE keyword and the INSTR. This difference (and others) between QDOS and SMSQ/E Basic variables is not documented (yet) in the SMSQ/E reference guide, but can be seen form the keys_sbasic file in the SMSQ/E sources. I will include something in the next version of the reference guide. Season's greetings to everyone! Wolfgang Probably because Qlib doesnt know that there are two different instr routines in SMSQ/E. The INSTR keyword is part of the S*BASIC language; it isnt like a toolkit function, so Qlib probably calls this routine directly which, unlike SBASIC's keyword, doesnt check the sb_cinst flag before execution. It could probably easily be fixed, but it still wouldnt work on a Qdos machine as the underlying code isnt there. Per ___ QL-Users Mailing List ___ QL-Users Mailing List
Re: [Ql-Users] INSTR_CASE
On 23/12/2021 22:31, desin via Ql-Users wrote: 100 OPEN #1,"con_" 110 WINDOW #1,256,256,0,0 120 CLS 130 a$= "hello" :b$= "Hello" 140 PRINT#1, a$,a$,a$ INSTR a$ 150 PRINT#1, a$,b$,a$ INSTR b$ 160 PRINT " case 1" 170 INSTR_CASE 1 180 PRINT#1, a$,a$,a$ INSTR a$ 190 PRINT#1, a$,b$,a$ INSTR b$ 200 PRINT " case 0" 210 INSTR_CASE 0 220 PRINT#1, a$,a$,a$ INSTR a$ 230 PRINT#1, a$,b$,a$ INSTR b$ 240 PAUSE #1 SMSQE works as expected but not as Qlib Job Any ideas ? <> Probably because Qlib doesnt know that there are two different instr routines in SMSQ/E. The INSTR keyword is part of the S*BASIC language; it isnt like a toolkit function, so Qlib probably calls this routine directly which, unlike SBASIC's keyword, doesnt check the sb_cinst flag before execution. It could probably easily be fixed, but it still wouldnt work on a Qdos machine as the underlying code isnt there. Per ___ QL-Users Mailing List