home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
CLIPPER
/
NFTROFF
/
6.TR
< prev
next >
Wrap
Text File
|
1993-12-01
|
16KB
|
958 lines
.de }n
.bp
.sp .5i
..
.wh -.8i }n
.sp .5i
.po -.4i
.ll 7.5i
.ps 9
.vs 9
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_COM3OR4() Enable use of COM3 and/or COM4 on IBM/PC compatables\.
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_COM3OR4()
Enable use of COM3 and/or COM4 on IBM/PC compatables\.
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_COM3OR4( <nPort> ) -> lSuccess
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<nPort>\fR is the COM port to enable\. Ports except 3 and 4 are ignored\.
The default is 3\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
a logical indicating success or failure of the operation\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_COM3OR4() uses FT_POKE() to write to memory the correct data
to enable COM3 or COM4 on IBM-PC compatables\. The programmer will
still need to explicitly open the port with SET PRINTER or FOPEN()
to send data out the port\.
.sp
FT_COM3OR4() owes everything to FT_POKE()\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
// attempt to enable COM3
.br
IF FT_COM3OR4( 3 )
.in 0.64i
.br
Qout("COM3 was enabled")
.in 0.4i
.br
END
.sp
.sp
.in 0.08i
\fBSource:\fR COM34\.PRG
.sp
\fBAuthor:\fR Steve Kolterman
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_DIR2DB() Create \.DBF of directory files, using DOS filespec
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_DIR2DB()
Create \.DBF of directory files, using DOS filespec
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_DIR2DB( <cSpec> [, <cDbf> ][, <cNtx> ][, <cDrvr> ] ) -> <nErrcode>
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cSpec>\fR can be any valid DOS file spec\., including wildcards and
.in 0.48i
single file names\.
.sp
.in 0.4i
\fB<cDbf>\fR is the name of the \.DBF to create\. If not specified, the
.in 0.48i
name \'FILES\' is used\.
.sp
.in 0.4i
\fB<cNtx>\fR is the name of the \.NTX to create\. If not specified, no
.in 0.48i
index is created\.
.sp
.in 0.4i
\fB<cDrvr>\fR is the name of the Nantucket RDD (replaceable database
.in 0.48i
driver) to use\. If not specified, the default, \'DBFNTX\', is
used\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
<nErrcode>, which will be one of the following:
.sp
.in 0.64i
.br
0 - no error
.br
1 - no file spec\. passed
.br
2 - no files match spec\. passed
.br
3 - network error opening <cDbf>
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_DIR2DB() builds a \.DBF from and fills it with the files/data
matching any valid DOS file spec\. Fields created are \'Name\',
\'Size\', \'Date\', \'Time\', and \'Attr\' (attribute)\.
.sp
An index on the \'name\' field is also created by passing a name
for the \.NTX as a third parameter\. An optional fourth parameter
accommodates the RDDs (replaceable database drivers) Nantucket
promises\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
nVal:= FT_DIR2DB( "*\.dbf","dbffiles","filename" )
Creates DBFFILES\.DBF consisting of all \.DBFs in the current dir-
ectory, and also creates FILENAME\.NTX\.
.sp
nVal:= FT_DIR2DB( "*\.*","pdoxdbf","pdoxntx","paradox" )
would create a Paradox database and index consisting of all files
in the current directory\.
.sp
.in 0.08i
\fBSource:\fR DIR2DBF\.PRG
.sp
\fBAuthor:\fR Steve Kolterman
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_EXIST() Test for existence of drive and/or subdirectory
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_EXIST()
Test for existence of drive and/or subdirectory
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_EXIST( <cDriveDir> ) -> lResult
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cDriveDir>\fR is a character string containing drive spec (with colon)
.in 0.64i
or drive spec and path to and including subdirectory being
tested for\. Do not include backslash after subdirectory\. If
drive spec is not part of string, tests current drive\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
.ta 0.88i
<lResult> as logical -
.br
.ta
.in 0.64i
.br
\.T\. if drive exists, or subdirectory exists on specified drive
.br
\.F\. if drive or subdirectory does not exist
.sp
.in 0.08i
\fBDescription
.sp
.sp
.sp
\fBExamples
.sp
.in 0.32i
IF FT_EXIST( "D:" )
.in 0.56i
Qout("OK To Perform Operation On Drive D:")
.in 0.32i
ENDIF
.sp
.in 0.08i
\fBSource:\fR EXIST\.PRG
.sp
\fBAuthor:\fR Steve Kolterman
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_GETE() Return the entire current environment
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_GETE()
Return the entire current environment
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_GETE( [ @<xReceiveVar> ] ) -> nNumStrings
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<xReceiveVar>\fR is the variable to receive the environment data\.
.sp
\fB<xReceiveVar>\fR can be a character type variable, in which case
the function will place all environment strings in the variable
separated by carriage return/line feeds (chr 13 + chr(10))\.
.sp
\fB<xReceiveVar>\fR can be an array type, in which case the function
will place each string in an array element\. The array MUST be
declared with the proper number of elements prior to passing it
to the function\. This can be done by calling FT_GETE() without
parameters first to get the number of strings in the environment\.
.sp
Note that the argument MUST be passed by reference\. Since arrays
are by nature passed by reference, the "@" symbol is optional when
passing an array\.
.sp
If no argument is passed, FT_GETE() merely returns the number
of strings in the environment\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
FT_GETE() returns the total number of strings found in the
current program\'s environment\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function stores ALL of the current program\'s environment
variables in either a block of text lines or in an array\. It is
useful for looking at the entire environment at once, or recording
a snapshot of it to a file for later inspection, such as when a
program error occurs\. If the value of ONE SPECIFIC variable is
desired, use Clipper\'s built-in GETE() function\.
.sp
This function uses the undocumented internal variable "_environ",
as well as the functions _strcpy(), _strcat(), and _strlen() from
CLIPPER\.LIB
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
Get the environment in text form and browse it:
.sp
.in 0.64i
.ta 0.96i
.br
cEnvBlock := ""
.br
.ta
.br
nNumStrings := FT_GETE(@cEnvBlock)
.ta 0.24i
.br
@ 0, 0 to MAXROW() - 1, MAXCOL()
.br
.ta
.ta 0.24i
.br
@ MAXROW(), 0 say \'Browse strings, press ESC to exit\.\.\.\'
.br
.ta
.br
MEMOWRIT(cEnvBlock, 1, 1, MAXROW() - 2,MAXCOL() - 1, \.F\.)
.sp
.in 0.4i
Get the environment in text form and write it to a file:
.sp
.in 0.64i
.br
cEnvBlock := ""
.br
FT_GETE(@cEnvBlock)
.br
MEMOWRIT("ENVIRON\.TXT", cEnvBlock)
.sp
.in 0.4i
Get the environment in Array form:
.sp
.in 0.64i
.br
aEnvArray := ARRAY(FT_GETE())
.br
FT_GETE(aEnvArray)
.ta 1.68i
.br
? aEnvArray[1] // "COMSPEC=C:\\COMMAND\.COM"
.br
.ta
.ta 1.68i
.br
? aEnvArray[2] // "PATH=C:\\;C:\\DOS;C:\\UTIL;C:\\CLIP50\\BIN"
.br
.ta
.in 0.8i
.br
\.\.\. etc \.\.\.
.sp
.in 0.08i
\fBSource:\fR GETENVRN\.C
.sp
\fBAuthor:\fR Rick Whitt
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_LINKED() Determine if a function was linked in
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_LINKED()
Determine if a function was linked in
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_LINKED( <cString> ) -> lResult
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cString>\fR is a character string containing one or more function
.in 1.2i
calls
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
\.T\. if all functions within the string are currently linked into
the application, \.F\. if one or more aren\'t\. See below for a
definition of "function\."
.sp
.in 0.08i
\fBDescription
.sp
.sp
.in 0.4i
This function would be used in data driven application to determine
whether or not a macro compiled function was linked in\.
.sp
Several functions can be passed, and nested, in <cString>\.
.sp
Caveat: Some function calls are converted by the preprocessor
into other function calls\. You cannot have these types of
functions in a macro compiled string as they never exist at
runtime\. FT_LINKED will correctly tell you that they are invalid\.
.sp
For instance: there is no function called SORT() in any of the
Nantucket LIBraries, but it is a valid CLIPPER command because the
preprocessor will convert it to other function calls\.
.sp
.sp
.sp
.in 0.08i
\fBExamples
.sp
.sp
.in 0.4i
.br
cString := "FT_GoodFunc(BadFunc(3,2))"
.br
IF FT_LINKED(cString)
.in 0.64i
.br
EVAL( &("{||"+cString+"}") )
.in 0.4i
.br
ELSE
.in 0.64i
.br
ALERT("Error: "+cString+" was not linked in\. Called by FT_LINKED()")
.in 0.4i
.br
ENDIF
.sp
.sp
.sp
.in 0.08i
\fBSource:\fR LINKED\.PRG
.sp
\fBAuthor:\fR Brian Loesgen
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ORIGIN() Report the drive, path and filename of the executing program
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ORIGIN()
Report the drive, path and filename of the executing program
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.32i
\fBFT_ORIGIN() -> cString
.sp
.in 0.08i
\fBArguments
.sp
.in 0.32i
None
.sp
.in 0.08i
\fBReturns
.sp
.in 0.32i
A string containing the full drive/directory/filename of
the currently executing file\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.32i
Often users will install multiple copies of application software,
especially on networks and in situations where the user is trying
to get around a copy protection scheme\.
.sp
This function enables you to learn the name and source location
of the currently executing file, so that you may take whatever
action you need to\.
.sp
Requires DOS v3\.xx and above\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.32i
.br
cMyFile := FT_ORIGIN()
.sp
.br
IF cMyFile <> "C:\\APPDIR\\MYFILE\.EXE"
.in 0.56i
.br
?"Incorrect startup file\. Please remove/rename and start again"
.br
QUIT
.in 0.32i
.br
ENDIF
.sp
.in 0.08i
\fBSource:\fR ORIGIN\.ASM
.sp
\fBAuthor:\fR Steve Larsen
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_WHEREIS()
, FT_TREE()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_RESTSETS() Restore status of all SET command settings
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_RESTSETS()
Restore status of all SET command settings
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_RESTSETS( [ <aOldSets> ] ) -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
aOldSets is an array of SET settings created by FT_SAVESETS()
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function "restores" the SET Settings, i\.e\., it sets them to the
values in the array aOldSets\. The following SETs are not currently
supported: FILTER, FORMAT, FUNCTION, INDEX, KEYS, MODE, ORDER,
PROCEDURE, RELATION, TYPEAHEAD
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
FT_RESTSETS(aOldSets)
.sp
.in 0.08i
\fBHeader File:\fR SET\.CH
.sp
\fBSource:\fR RESTSETS\.PRG
.sp
\fBAuthor:\fR David Husnian
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_SAVESETS()
, FT_SETCENTURY()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_SAVESETS() Save the status of all the SET command settings
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_SAVESETS()
Save the status of all the SET command settings
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_SAVESETS() -> aOldSets
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
None
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
An array containing the values of the supported SETs\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function saves the SET Settings, i\.e\., it copies them into an
array, aOldSets\. The following SETs are not currently supported:
FILTER, FORMAT, FUNCTION, INDEX, KEYS, MODE, ORDER, PROCEDURE,
RELATION, TYPEAHEAD
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
aOldSets := FT_SAVESETS()
.sp
.in 0.08i
\fBHeader File:\fR SET\.CH
.sp
\fBSource:\fR SAVESETS\.PRG
.sp
\fBAuthor:\fR David Husnian
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_RESTSETS()
, FT_SETCENTURY()
.ta
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_SETCENTURY() Check/Set the CENTURY Setting
.br
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_SETCENTURY()
Check/Set the CENTURY Setting
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_SETCENTURY( [ <lNewSetState> ] ) -> <lOldState>
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
lNewSetState - Boolean to Set CENTURY
.in 1.76i
.br
\.F\. - Toggle CENTURY off
.br
\.T\. - Toggle CENTURY on
.br
If not specified, leave CENTURY as is
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
The state of the CENTURY setting upon entry to the routine
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function returns the state (ON/OFF, TRUE/FALSE) of the CENTURY
and optionally sets it ON or OFF\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.ta 2.64i
lOldState := FT_SETCENTURY() // Get current CENTURY Setting
.br
.ta
.sp
.ta 2.64i
lOldState := FT_SETCENTURY(\.T\.) // Get the current CENTURY Setting
.br
.ta
.in 3.04i
// and turn it on (set it to TRUE)
.sp
.in 0.4i
.ta 2.64i
lOldState := FT_SETCENTURY(\.F\.) // Get the current CENTURY Setting
.br
.ta
.in 3.04i
// and turn it off (set it to FALSE)
.sp
.in 0.08i
\fBSource:\fR CNTRYSET\.PRG
.sp
\fBAuthor:\fR David Husnian
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_TREE() Locate all directories and subdirectories on a drive
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_TREE()
Locate all directories and subdirectories on a drive
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.32i
\fBFT_TREE( [ <cDrive:> ] ) -> aDirectories
.sp
.in 0.08i
\fBArguments
.sp
.in 0.32i
\fB<cDrive:>\fR is an optional drive to search\. If omitted, FT_TREE()
defaults to the current drive\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.32i
An array containing the name of each directory found on the specified
drive\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.32i
Use FT_TREE() to obtain an array of the directory structure of a
specified drive\.
.sp
You may optionally specify a drive to search, other than the current
drive\. Please note that FT_TREE() will not cause a runtime error if
you specify an invalid or inoperable drive, instead returns an
empty array\.
.sp
The directory structure returned is not ordered in any way other than
the order that the directories are contained in DOS\. To put the
directories in alphabetical order, use ASORT()\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.32i
.br
// list all directories on the current drive
.br
aTree := FT_TREE()
.br
Aeval( aTree, {|e| Qout(e) } )
.sp
.in 0.08i
\fBSource:\fR WHEREIS\.PRG
.sp
\fBAuthor:\fR Steve Larsen
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_WHEREIS()
, FT_ORIGIN()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_WHEREIS() Locate all occurrences of a filespec on a drive
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_WHEREIS()
Locate all occurrences of a filespec on a drive
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.32i
\fBFT_WHEREIS( [ <cDrive:> ][ <cFilespec> ] ) -> aFiles
.sp
.in 0.08i
\fBArguments
.sp
.in 0.32i
\fB<cDrive:>\fR is an optional drive to search\. If omitted, FT_WHEREIS()
defaults to the current drive\.
.sp
\fB<cFilespec>\fR is a DOS legal filespec containing the pattern that
you want found\. The wildcard characters "*" and "?" are supported\.
If no \fB<cFilespec>\fR is specified, FT_WHEREIS() defaults to all files\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.32i
An array of filenames that match <cFilespec>\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.32i
Use FT_WHEREIS() to obtain an array with the full path/filenames of all
files on the specified or current drive that match a DOS legal filespec\.
.sp
You may optionally specify a drive to search, other than the current
drive\. Please note that FT_WHEREIS() will not cause a runtime error if
you specify an invalid or inoperable drive; it instead returns an
empty array\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.32i
.br
/* Example 1 */
.br
aComSpec := FT_WHEREIS( "command\.com" ) // aComSpec now contains an
.in 3.52i
.br
// entry for every "Command\.com"
.br
// on the current drive
.in 0.32i
.br
/* Example 2 */
.br
aBat := FT_WHEREIS( "a:*\.bat" )
.sp
.br
IF Empty( aBat )
.in 0.56i
.br
?"Please make sure the proper diskette is in drive A:, and that"
.br
?"the drive door is closed\."
.in 0.32i
.br
ELSE
.in 0.56i
.br
? "You have " + Len( aBat ) " batch files on drive A:"
.in 0.32i
.br
ENDIF
.sp
.in 0.08i
\fBSource:\fR WHEREIS\.PRG
.sp
\fBAuthor:\fR Steve Larsen
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_TREE()
, FT_ORIGIN()