Page 1 of 1
Executing SBASIC programs from hotkeys
Posted: Thu Jun 15, 2023 1:59 pm
by dilwyn
Hopefully, this is nothing more than my forgetfulness...
I want to set up a hotkey to execute an SBASIC program. Obviously I can do something like this with HOT_CMD to send a command to SBASIC to issue an EX win1_sbasicprogname_bas command to BASIC.
ERT HOT_CMD("s","EX sbasicprogname_bas")
Which works OK, but I couldn't get program starting commands like HOT_LOAD to do this - ERT HOT_LOAD("s","win1_sbasicprogname_bas") just grunts and fails to start the program when I try to use it.
Am I missing something obvious here, or is this not possible? Maybe it has to do with who owns the SBASIC job - that it has to be started from the main SBASIC?
Re: Executing SBASIC programs from hotkeys
Posted: Thu Jun 15, 2023 3:18 pm
by tofro
dilwyn wrote: Thu Jun 15, 2023 1:59 pm
Hopefully, this is nothing more than my forgetfulness...
I want to set up a hotkey to execute an SBASIC program. Obviously I can do something like this with HOT_CMD to send a command to SBASIC to issue an EX win1_sbasicprogname_bas command to BASIC.
ERT HOT_CMD("s","EX sbasicprogname_bas")
Which works OK, but I couldn't get program starting commands like HOT_LOAD to do this - ERT HOT_LOAD("s","win1_sbasicprogname_bas") just grunts and fails to start the program when I try to use it.
Am I missing something obvious here, or is this not possible? Maybe it has to do with who owns the SBASIC job - that it has to be started from the main SBASIC?
Dilwyn,
even if the command name may suggest HOT_LOAD has anything to do with "LOAD" - It hasn't. HOT_LOAD belongs into the league of HOT_CHP and can only load and start executable programs. And, even if you can EXEC them, SBASIC programs just aren't.....
You can start SBASIC programs using HOT_CMD, but that simply pushes your command string to the current SBASIC input line - If that SBASIC interpreter is not idle atm, it won't work..
Thankfully, there is the SBASIC thing that can be employed:
Code: Select all
ERT HOT_THING ("<key>","SBASIC";"<command string>", "<job name")
Will start a new SBASIC interpreter and execute the command string in there - And thus should do what you want. <command string> can obviously contain DO or LRUN statements so you can execute large SBASIC programs. The program should contain a "QUIT" statement, otherwise you'd have got lots of interpreters lurking in the background after some time.
Re: Executing SBASIC programs from hotkeys
Posted: Thu Jun 15, 2023 3:19 pm
by Derek_Stewart
Hi Dilwyn,
Try:
ERT HOT_THING('s',"SBASIC";"LRUN 'sbasicprogname_bas"")
Should load SBASIC and put the LRUN statement into the SBASIC channel #0
But, too late... Torfro beat me
Re: Executing SBASIC programs from hotkeys
Posted: Thu Jun 15, 2023 3:23 pm
by dilwyn
Great, thanks guys. I'd forgotten about the sbasic thing. Will give it a go shortly.