Hi,
I haven't tested your "colon" example, cause I do not need it and even don't know why it's needed on a multitasking operating system like QDOS (SMS...). Normally you switch on your QL and run your boot program, where you setup the directories of the PTH device and set the environment variables for all of your programs (a lot of programs now support environment variables, especially C programs compiled with C68 or GCC cross compiler and of course S*BASIC).
If you are using a BBQL with version before JS (extensions loaded in a SuperBASCIC program cannot be used in this program) you must split your boot program in 2 SuperBASIC programs (
note: All programs only tested for syntax, I have not run them; i.e. they will load without MISTake):
boot (assuming your extensions are in "MDV1_etc_"):
Code: Select all
100 etc$='MDV1_etc_'
140 adr=RESPR(1516):LBYTES etc$&'Pth_rext',adr:call adr:REMark Load the Path device which supports a search path
180 adr=RESPR(896):LBYTES etc$&'env_bin',adr:call adr:REMark Load the environment variables support for QDOS
220 LRUN'MDV1_boot2'
boot2:
Code: Select all
100 REMark Just an example, you can add as many path names as you want
140 PTH_ADD'MDV1_'
180 PTH_ADD'MDV1_bin_'
220 PTH_ADD'MDV1_usr_bin_'
260 PTH_ADD'n2_MDV1_'
300 REMark Set data directory for a SuperBASIC program of your own:
340 SET_ENV'HOME=MDV2_home_popopo_'
380 REMark If you have Toolkit II you can (should) also use:
420 REMark PROG_USE'PTH1_'
460 REMark Then you can e. g. just use: LRUN myprog_bas
If you now want to start a program e.g. myDoWhatIAmThinking_bas just use:
LRUN PTH1_myDoWhatIAmThinking_bas
and it will find it if it is on MDV1_, MDV1_bin_, MDV1_usr_bin_ or on station 2 in MDV1_.
In your SuperBASIC program you can get your home directory with:
Code: Select all
100 home$=GETENV$('HOME'):REMark case of environment variable 'HOME' must be preserved(!)
140 REMark home$ now holds 'MDV2_home_popopo_' and environment variables will NOT be cleared by new or clear(!)
180 mydata='Lorem ipsum...'
220 OPEN#4,home$&'myfile_dat'
260 PRINT#4,mydata
300 CLOSE#4
Now on your MDV2_ there should be the file:
home_popopo_myfile_dat
As you can see Pth_rext and env_bin are really small (about 2.5 KByte) and you can find them here:
https://dilwyn.theqlforum.com/tk/index.html
Environment Variables v1.07 (from C68 compiler) and Path (from Phil Borman). There is also Drivers.zip on this page with all drivers from Phil Borman (PTH, REDIRECT and SUB) which are all very useful (IMHO).
AND ONE BIG ERROR IN YOUR PROGRAM:
You are using:
Code: Select all
50 CheckF = 800 : REMark Line for checking procedure
This is horror of horror(!):
You cannot RENUMber this program afterwards! The RENUM command does not check for variables which hold a line number. Try: