Previous Top Index Next

External DOS Functions (DOS)

The following routines are available after loading the library file dos.r with the command: CALL import "dos.r".

SEG(addr)

Returns the segment of a normalised address addr.
SAY seg("CC002"h) /* "CC00"h */
SAY seg(245) /* 15 */

OFS(addr)

Returns the offset of a normalised address addr.
SAY ofs("CC002"h) /* "2" */
SAY ofs(245) /* 5 */

INTADDR(int)

Returns the normalised address of the interrupt int.

ASCIIZ(string)

Returns a valid rexx string from an Ascii Zero terminated string
SAY asciiz("41420043"x) /* "AB" */

ATTR2STR(fileattr)

Translate the file attributes fillattr to a printable string.

SETDTA()

Setups the dta space as a variable of size 128 in the main pool under the name '#dta' Must be called ONLY ONCE before calling the FindFirst FindNext functions.

DTA2STR()

Translates the #dta variable initialised by SETDTA() to a readable string.

FINDFIRST(pattern[,attributes])

Returns the first file found in format given by FORMATDTA() pattern can be any normal dos search pattern ie.'*.*' '??XX.R' etc. attributes is a string containing the attributes of the files to be searched. Can be any combination of the following (only the capital letter) Readonly,Hidden,System,Volume,Directory or Archive
CALL FindFirst('*.*','HDA')
find all Hidden, Directories and Archives returns the File Data or in error "NOTFOUND" or "ERROR" when an attribute is wrong

FINDNEXT()

Return the next file data otherwise returns 'END'

DISKRESET()

This function flushes all file buffers but does not close files.

GETCURDISK()

Returns current disk name()

SELECTDRIVE(drive)

Select default drive from 'A' to 'Z' returns the number of logical drives in the system

DOSVERSION()

Returns the DOS version.

GETCURDIR([drive])

Returns current directory for drive drive if exists, otherwise for current drive.

CHDIR(newdirectory)

Change directory to newdirectory. Returns 0 if everything is ok, otherwise 1.

DRIVESPACE([drive])

Returns in bytes the free space for drive drive and the total space. Default is the current drive.

FILEATTR(file[,attributes])

Returns the file attributes. If attributes exist the it changes the file attributes to attributes.

MACHINENAME()

Returns the machine name.


Previous Top Index Next