SuperBASIC or SBASIC Editor

A place to discuss general QL issues.
Post Reply
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

SuperBASIC or SBASIC Editor

Post by Mr_Navigator »

Does anyone know if anyone has attempted a text editor for writing SuperBASIC or SBASIC code that runs in say Windows or OSX, that when the user wants to run the code the programs invokes a QL emulator and passes the code file to it for interpretation?

If not anyone fancy writing one?


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
User avatar
polka
Trump Card
Posts: 191
Joined: Mon Mar 07, 2011 11:43 am

Re: SuperBASIC or SBASIC Editor

Post by polka »

I have a windows editor that may invoque a dos command line and thus lauch an application with parameters (including the fliname currently edited). But the question is : does any QL emulator have the capacity to boot, loading and automatically running a PC text file which name it gets in the command line starting it ? My Qemulator and my Q-PC2 do not seem to ...


Paul


May the FORTH be with you !
POLKa
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: SuperBASIC or SBASIC Editor

Post by Mr_Navigator »

polka wrote:I have a windows editor that may invoque a dos command line and thus lauch an application with parameters (including the fliname currently edited). But the question is : does any QL emulator have the capacity to boot, loading and automatically running a PC text file which name it gets in the command line starting it ? My Qemulator and my Q-PC2 do not seem to ...


Paul
Well I only now think it is possible as the Games Collection 1 with Q-emuLator does something similar, albeit it is not the full version but a runtime version I am led to believe.


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
User avatar
dilwyn
Mr QL
Posts: 2750
Joined: Wed Dec 01, 2010 10:39 pm

Re: SuperBASIC or SBASIC Editor

Post by dilwyn »

polka wrote:I have a windows editor that may invoque a dos command line and thus lauch an application with parameters (including the fliname currently edited). But the question is : does any QL emulator have the capacity to boot, loading and automatically running a PC text file which name it gets in the command line starting it ? My Qemulator and my Q-PC2 do not seem to ...
Paul
At the risk of not properly understanding what you want to do, I would suggest the use of QPC_CMDLINE$ to pick up this text string or filename passed to it. Your QPC2 boot program would check for this and start the appropriate program.

Information about this on page 5 and 7 of the QPC2 manual (at least in my version of the manual). QPC2 would be launched with a DOS command line like:

QPC2.EXE -cmdline "text"

Your boot program for QPC2 would then have a command line like

cd$=QPC_CMDLINE$
IF cd$ <> "" THEN
LRUN cd$
REM or do what you like with cd$
REM such as Ex Win1_myfavouriteeditor;cd$
END IF

A possibility would be for your QPC boot program to check for filename extensions _bas, .bas, _sav, .sav to make sure it is filename of BASIC program, then LOAD or LRUN it, or handle it how you want.

As the format of DOS/Windows and QL style filenames are different you'd have to either parse the filename accordingly, or assume it always comes from the same location e.g. c:\qlfiles\ so that the LRUN command becomes something like LRUN 'dos1_qlfiles_'&cmd$

I've never really used this so don't know if it would work. Also, parsing the passed DOS/Windows filename is likely to be fiddly to convert it to a QL style filename. You'd probably have to parse it and assume that:

Name starting with letter and colon and backslash (e.g. c:\) is a drive name - if c:\ convert to dos1_ etc as per how you have configured your QPC dos drives.

Extract any directory names surrounded by backslash characters. Remove the slashes and add '_' as appropriate.

Anything after the last backslash (or of there is no backslash) is the 'pure' filename added to the drive/directory name already built.

Another less likely approach is to configure different versions of the QPC2 operating system to do different things, passing the OS location via the command line option -os file:

QPC2.EXE -os file -cmdline "string"

I''m not sure all this fits in with what you want to achieve, but might give a few ideas to inspire you to explore what is possible.

Dilwyn


Post Reply