Page 2 of 2

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

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

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

Posted: Mon Feb 17, 2025 10:27 pm
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)

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

Posted: Tue Feb 18, 2025 7:34 am
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.

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

Posted: Wed Feb 19, 2025 5:30 pm
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.

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

Posted: Wed Feb 19, 2025 5:48 pm
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.