BASIC_INDEX%() and SBASIC/MultiBASIC
Posted: Wed Jun 07, 2023 8:22 pm
The SuperBASIC SBASCIC Reference Manual says there is TurboFix_bin to make the BASIC_INDEX% function compatible with SBASIC and MultiBASIC. Dilwyn's Download Page for Turbo states that TurboFix is no more needed for current versions of Turbo Toolkit. I have tried Turbo Toolkit v3.44 and the patched version in Turbo510 (also from Dilwyn's page), but both don't work in a second SBASIC job on QPC (-12 is returned). I use it in the following batch file (for moving the SBASIC with it's default windows. I call it via (which I have on a hotkey) "x_%=InsVal:y%=InsVal:DO'resetSB_bat'":
This works perfectly in job 0,0 but not in secondary SBASICs.
Must the current (v3.44) version of TurboToolkit be patched with TurboFix to support SBASIC secondary jobs or is it not possible to use BASIC_INDEX% in secondary SBASICs?
Is there a comparable function to test if a variable exists? Unfortunately I cannot use WHEN ERRor in a batch file and I don't want to make it a BASIC program, cause then when moving the SBASIC windows the currently loaded BASIC program will be lost.
Code: Select all
IF BASIC_INDEX%("x_%")<0:PRINT#0,"x_% (or y_%) not set! Aborting":END_CMD
IF BASIC_INDEX%("y_%")<0:PRINT#0,"y_% (or x_%) not set! Aborting":END_CMD
IF x_%<0 OR x_%>512:PRINT#0,"x_% must be in range 0..512!":END_CMD:REMark x%=x_%
IF y_%<0 OR y_%>512:Print#0,"y_% must be in range 0..512!":END_CMD:REMark y%=y_%
PRINT#0,"Reset SuperBASIC origin to "&x_%&", "&y_%&"?";
CURSEN#0:a_$=INKEY$(#0,-1):CURDIS#0
IF a_$<>'y'AND a_$<>'Y':PRINT#0,"User abort":END_CMD
PAPER#2,0:PAPER#1,0:PAPER#0,0
BORDER#2,0:BORDER#1,0:BORDER#0,0:CLS#2:CLS#1:CLS#0
WINDOW#2,256,202,x_%,y_%:WINDOW#1,256,202,x_%+256,y_%:WINDOW#0,512,54,x_%,y_%+202
CLS#0:WINDOW#0,512,54,x_%,y_%+202
BORDER#2,1,255:BORDER#1,1,255:BORDER#0,1,255
PAPER#2,7:PAPER#1,2:PAPER#0,0:CLS#2:CLS#1:CLS#0
END_CMD
Must the current (v3.44) version of TurboToolkit be patched with TurboFix to support SBASIC secondary jobs or is it not possible to use BASIC_INDEX% in secondary SBASICs?
Is there a comparable function to test if a variable exists? Unfortunately I cannot use WHEN ERRor in a batch file and I don't want to make it a BASIC program, cause then when moving the SBASIC windows the currently loaded BASIC program will be lost.