Dec 082017
 
Clarion 2.0/2.1 Language Extension Module containing file and directory functions.
File DOSTOOLS.ZIP from The Programmer’s Corner in
Category Databases and related files
Clarion 2.0/2.1 Language Extension Module containing file and directory functions.
File Name File Size Zip Size Zip Type
DOSTOOLS.ASM 53244 10302 deflated
DOSTOOLS.BAT 122 59 deflated
DOSTOOLS.BIN 3494 1730 deflated
DOSTOOLS.CPY 1286 431 deflated
DOSTOOLS.DOC 9325 2404 deflated
LEMMAC.INC 1546 555 deflated

Download File DOSTOOLS.ZIP Here

Contents of the DOSTOOLS.DOC file




DOSVER()

The DOSVER() function returns the current dos version major and minor
added together as a long.

CHK8087()

The CHK8087() function checks for a math coprocessor, and returns
the status as a long.

Example:
CHK8087()

Status: 0 - No Math processor
1 - Math processor install

GETVERFY()

The GETVERFY() function returns the current status of the DOS verify
switch as a long.

Example:
GETVERFY()

Status: 0 - Off
1 - On

PRINTSCN()

The PRINTSCN() function uses the BIOS print screen (INT 5) to send
the current screen to the printer attached as LPT1. A status code
is returned as a long.

Example:
PRINTSCN()

Status: 0 - Ok
1 - Error
2 - Print screen already active

PRTSTAT(prtid)

The PRTSTAT() function returns the status of the printer specified
by prtid. Prtid may be any of the vaild names listed below, if
a invalid name is passed the name of LPT1 will be used. The status
code is returned as a long.

Example:
PRTSTAT('LPT1')
PRTSTAT('LPT3')

Vaild Names: LPT1
LPT2
LPT3
PRN (LPT1)

Status: 0 - Online and ready
1 - Timedout
2 - Unknowed
4 - Unknowed
8 - I/O error
20 - Out of paper

GETATTR(filename)

The GETATTR() function returns the attributes for the file specified
by filename as a long. A error status is posted to ERRORCODE().

Example:
GETATTR('demo.fil')
GETATTR('dostools.asm')

Attributes: 00H - Normal
01H - Read only
02H - Hidden
04H - System
20H - Archive

GETFILSZ(filename)

The GETFILSZ() function returns the file size for the file specified
by filename in bytes as a long. A error status is posted to ERRORCODE().

Example:
GETFILSZ('demo.fil')
GETFILSZ('dostools.asm')

CURDISK()

The CURDISK() function returns the current selected disk as a one byte
string.

Example:
If the current disk drive is drive C then

CURDISK()

would return a 'C'.

CURPATH()

The CURPATH() function returns the current path name of the currently
selected disk drive as a string. A error status is posted to
ERRORCODE().

Example:
If the current disk drive is drive C and the current
path is dostools

CURPATH()

would return 'C:\DOSTOOLS'

PGMPATH()

The PGMPATH() function returns the current path name of the path that
the current executing program was loaded from. This function requires
DOS 3.0 or higher. A error status is posted to ERRORCODE().

Example:
The current disk drive is drive C and the current
path is DOSTOOLS, program EDIT is executing and was
found and loaded from directory WORDPROC on drive D

PGMPATH()

would return 'D:\WORDPROC'

COMMAND_LINE()
The COMMAND_LINE() function returns the command line arguments
passed to the current executing program.

Example:
The program DEMO is executing and was invoked from
the DOS command line as DEMO ARG1 ARG2

COMMAND_LINE()

would return ' ARG1 ARG2'

ENVIRONMENT(environment_variable)
The ENVIRONMENT() function returns the value of a DOS environment
string.

Example:
The command SET CLATMP=C:\TEMP was executed prior to
running the program DEMO.

ENVIRONMENT('CLATMP')

would return 'C:\TEMP'

VOL_LBL(disk)
The VOL_LBL() function returns a string containing the label
of a DOS disk. A error status is posted to ERRORCODE().

Example:
The diskette in drive B was formatted with a label
of 'VOLUMELABEL'.

VOL_LBL('B')

would return 'VOLUMELABEL'


SETATTR(filename,attributes,onoff)

The SETATTR() procedure sets the attributes for the file specified
by filename on or off. A error status is posted to ERRORCODE().

Example:
SETATTR('demo.fil',20H,0) - archive on
SETATTR('demo.fil',22H,0) - archive & hidden on
SETATTR('demo.fil',04H,1) - system off
SETATTR('demo.fil',00H,0) - reset all attributes

Attributes: 00H - Normal
(Short) 01H - Read only
02H - Hidden
04H - System
20H - Archive

Onoff:0 - On
(Short)1 - Off

SETVERFY(onoff)

The SETVERFY() proceduce sets the DOS verify flag on or off.

Example:
SETVERFY(0) - Off
SETVERFY(1) - On

Onoff: 0 - Off
(Short) 1 - On

SETFIRST(filemask)

The SETFIRST() procedure is used to position the directory at the
first file matching the mask specifed by filemask. This procedure
does not return any file information, the FINDNEXT() procedure
must be used to return information on the first entry. A error
status is posted to ERRORCODE().

Example:
SETFIRST('*.*') - All files
SETFIRST('*.cla') - All files with the extension of 'cla'
SETFIRST('*.??a') - All files that match the extension of
'??a' (cla,bta,dta, etc.)

FINDFIRST(filemask,findfgrp)

The FINDFIRST() procedure is used to position the directory at the
first file matching the mask specifed by filemask. This procedure
then returns the first entry formated into the group specifed by
findfgrp. A error status is posted to ERRORCODE().

Example:
FINDFIRST('*.*',findfgrp) - All files
FINDFIRST('*.cla',findfgrp) - All files with the extension
of 'cla'
FINDFIRST('*.??a',findfgrp) - All files that match the
extension of '??a' (cla,bta,
dta, etc.)

Findfgrp: FINDFGRP GROUP
TYPESTRING(1) !ENTRY TYPE
! 1 - CUR DIRECTORY
! 2 - PRE DIRECTORY
! 3 - SUB DIRECTORY
! 4 - FILE
ATTRIBSTRING(4) !ATTRIBUTES OF FILE
TIMESTRING(5) !TIME HH:MM
DATESTRING(8) !DATE MM/DD/YY
SIZELONG !SIZE OF FILE
NAMESTRING(8) !FILE NAME
EXTSTRING(3) !FILE EXTENSION
.

FINDNEXT(findfgrp)

The FINDNEXT() procedure is used to return the next entry matching
the mask set by SETFIRST() or FINDFIRST() procedure. The entry is
returned formated into the group specifed by findfgrp. A error
status is posted to ERRORCODE().

Example:
FINDNEXT(findfgrp) - Next entry

Findfgrp: FINDFGRP GROUP
TYPESTRING(1) !ENTRY TYPE
! 1 - CUR DIRECTORY
! 2 - PRE DIRECTORY
! 3 - SUB DIRECTORY
! 4 - FILE
ATTRIBSTRING(4) !ATTRIBUTES OF FILE
TIMESTRING(5) !TIME HH:MM
DATESTRING(8) !DATE MM/DD/YY
SIZELONG !SIZE OF FILE
NAMESTRING(8) !FILE NAME
EXTSTRING(3) !FILE EXTENSION
.

CHPATH(pathname)

The CHPATH() procedure sets the current or default, directory to
the drive and path specified by pathname. Please note this procedure
does not change the default drive. A error status is posted to
ERRORCODE().

Example:
CHPATH('\newpath') - Changes current path to newpath on
current dirve
CHPATH('b:\newpath') - Changes current path on drive 'B' to
newpath
CHPATH('\new\xxx') - Changes current path to new\xxx on
current drive

RMPATH(pathname)

The RMPATH() procedure removes the directory specified by pathname
Please note this procedure does not change the default drive. A error
status is posted to ERRORCODE().

Example:
RMPATH('\newpath') - Remove newpath from current drive
RMPATH('b:\newpath') - Remove newpath from drive 'B'
RMPATH('\new\xxx') - Remove xxx from path new on current
drive

MKPATH(pathname)

The MKPATH() procedure creates a directory using the drive and path
specified by pathname. Please note this procedure does not change the
default drive. A error status is posted to ERRORCODE().

Example:
MKPATH('\newpath') - Create newpath on current drive
MKPATH('b:\newpath') - Create newpath from drive 'B'
MKPATH('\new\xxx') - Create xxx under path new on current
drive

SETDISK(drive)

The SETDISK() procedure the current dos disk drive to the drive
specified by drive. Please note this procedure does change the
default drive. A error status is posted to ERRORCODE().

Example:
SETDISK('d') - Set current drive to 'D'
SETDISK('b') - Set current drive to 'B'
SETDISK('c') - Set current drive to 'C'

GODOS(runcode)
The GODOS() procedure exits the currently executing program,
sets the ERRORLEVEL, and returns to DOS.

Example:
GODOS(1) - Exit and set errorlevel to 1

SPOOL(filename)
The SPOOL() procedure queues filename to be printed by the
PRINT command.


Example:
SPOOL('DEMO.LST') - Queue the file DEMO.LST in the
current directory for printing


 December 8, 2017  Add comments

Leave a Reply