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