At line 20594:4 fatal error in SBASIC interpreter

Anything QL Software or Programming Related.
User avatar
RalfR
QL Wafer Drive
Posts: 1177
Joined: Fri Jun 15, 2018 8:58 pm

Re: At line 20594:4 fatal error in SBASIC interpreter

Post by RalfR »

I do not understand the use of "DEVICE_STATUS", when all TK2 functions are available...? Any advantages?


7000 4E75
User avatar
tofro
Font of All Knowledge
Posts: 3071
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: At line 20594:4 fatal error in SBASIC interpreter

Post by tofro »

RalfR wrote: Mon Feb 17, 2025 5:14 pm I do not understand the use of "DEVICE_STATUS", when all TK2 functions are available...? Any advantages?
I think I can guess why:

TK2 sometimes does very odd things with its default devices - If you, for example, want to open "mdv1_test" on a machine without mdvs, instead of failing, it will happily create a file "mdv1_test" on the default device and make you think you can. write to a micro drive - DEVICE_STATUS ignores the default devices completely and just lets you aim more safely.

The fact that the default devices are global for all jobs doesn't make it any better (otherwise, you could reset them to empty temporarily and avoid this problem.)

It would improve things a lot when TK2 would check whether the first part of a file name is a valid device name and not apply this mechanism (i.e. recognize this is an absolute path and treat it as such)


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
RalfR
QL Wafer Drive
Posts: 1177
Joined: Fri Jun 15, 2018 8:58 pm

Re: At line 20594:4 fatal error in SBASIC interpreter

Post by RalfR »

tofro wrote: Mon Feb 17, 2025 10:27 pmIt would improve things a lot when TK2 would check whether the first part of a file name is a valid device name and not apply this mechanism (i.e. recognize this is an absolute path and treat it as such)
Yes, that's the problem I mentioned recently. But Marcel has changed it in the current version so that it checks whether the first part of the file name is also a valid device.

---------- snip ----------
V2.35
- Don't add default directory to names starting with a drive
---------- snap ----------

So, no more "flp1_mdv1_test". As I have written, this is the first time, where you can use "FTEST" in a real way.


7000 4E75
User avatar
ql_freak
Gold Card
Posts: 479
Joined: Sun Jan 18, 2015 1:29 am

Re: At line 20594:4 fatal error in SBASIC interpreter

Post by ql_freak »

RalfR wrote: Mon Feb 17, 2025 5:14 pm I do not understand the use of "DEVICE_STATUS", when all TK2 functions are available...? Any advantages?
I think DEVICE_STATUS() is more powerful than FTEST(). I assume Simon needed such a powerful file test function when writing SuperCharge and Turbo. In my function I should use DEVICE_STATUS(2, ...) instead of DEVICE_STATUS(1, ...) and there is also DEVICE_STATUS(-1, ...). The other advantage is, that it does not use the DATAD$ directory.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
ql_freak
Gold Card
Posts: 479
Joined: Sun Jan 18, 2015 1:29 am

Re: At line 20594:4 fatal error in SBASIC interpreter

Post by ql_freak »

RalfR wrote: Mon Feb 17, 2025 6:23 am This will happen for all variables that match the capitalized part of QDOS' own keywords, e.g.:

RETurn, ERRor, PROCedure, FuNction, REPeat, DEFine etc.
Thank you Ralf. This is what I have assumed in my starting thread (WHEN ERRor), but I thought because of the trailing % it's another name.
For a procedure or function it is enough to simply write "def proc" or "def fn" in ED. Interestingly, this only works with QDOS's own commands, not with loaded toolkits.
I think because these are all no normal SuperBASIC MC procedures/functions, but real keyword which have direct effects on the SuperBASIC program (like e.g. REPeat). I assume it's not possible to write a SuperBASIC MC procedure which does similar as REPeat or WHEN ERRor. GO TO is another example, if you write GOTO it will be expanded to GO TO.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Post Reply