Quote:
|
Quote:
| does it also include saving the configuration?
|
ah, yes, that was what I forgot to ask. it works now, but I need to know one thing: how do I find out the drive letter, where a program was started from in Msx-Dos?
|
from DOS2PROG.DOC
3.5 ENVIRONMENT STRINGS
MSX-DOS maintains a list of "environment strings" in it's data segment.
An environment string is a named item which has a value associated with it.
Both the name and the value are user-defined. Environment strings are
accessed at the function call level via the "Get Environment String"
(function 6BH), "Set Environment String" (function 6CH) and "Find Environment
String" (function 6DH) functions.
....
The PROGRAM environment string has several uses. The main use is that a
program can use it to load overlay files from the same directory as it was
loaded from. The last item in PROGRAM (ie. the actual program filename) is
replaced with the name of the overlay file, and then the new string can be
passed to any of the new MSX-DOS 2 functions that take ASCIIZ strings (such
as "Open File"

.
--------------------------------------
from DOS2FUNC.DOC
3.87 GET ENVIRONMENT ITEM (6BH)
Parameters: C = 6BH (_GENV)
HL = ASCIIZ name string
DE = Pointer to buffer for value
B = Size of buffer
Results: A = Error
DE = Preserved, buffer filled in if A=0
This function gets the current value of the environment item whose name is
passed in register HL. A ".IENV" error is returned if the name string is
invalid. If there is no environment item of that name then a null string will
be returned in the buffer. If there is an item of that name then its value
string will be copied to the buffer. If the buffer is too small then the
value string will be truncated with no terminating null and a ".ELONG" error
will be returned. A buffer 255 bytes will always be large enough since value
strings cannot be longer than this (including the terminating null).
3.88 SET ENVIRONMENT ITEM (6CH)
Parameters: C = 6CH (_SENV)
HL = ASCIIZ name string
DE = ASCIIZ value string
Results: A = Error
This function sets a new environment item. If the name string is invalid
then a ".IENV" error is returned, otherwise the value string is checked and a
".ELONG" error returned if it is longer than 255 characters, or a ".NORAM"
error if there is insufficient memory to store the new item. If all is well
then any old item of this name is deleted and the new item is added to the
beginning of the environment list. If the value string is null then the
environment item will be removed.
3.89 FIND ENVIRONMENT ITEM (6DH)
Parameters: C = 6DH (_FENV)
DE = Environment item number
HL = Pointer to buffer for name string
Results: A = Error
HL = Preserved, buffer filled in
This function is used to find out what environment items are currently
set. The item number in register DE identifies which item in the list is to
be found (the first item corresponds to DE=1). If there is an item number
<DE> then the name string of this item will be copied into the buffer pointed
to by HL. If the buffer is too small then the name will be truncated with no
terminating null, and a ".ELONG" error returned. A 255 byte buffer will never
be too small. If there is no item number <DE> then a null string will be
returned, since an item can never have a null name string.
