FT Environment

 FT_COM3OR4()     Enable use of COM3 and/or COM4 on IBM/PC compatables.
 FT_DIR2DB()      Create .DBF of directory files, using DOS filespec
 FT_EXIST()       Test for drive and/or subdir on SINGLE-USER systems only.
 FT_GETE()        Return the entire current environment
 FT_LINKED()      Determine if a function was linked in
 FT_ORIGIN()      Report the drive, path and filename of the current program
 FT_RESTSETS()    Restore status of all SET command settings
 FT_SAVESETS()    Save the status of all the SET command settings
 FT_SETCENTURY()  Check/Set the CENTURY Setting
 FT_TREE()        Locate all directories and subdirectories on a drive
 FT_WHEREIS()     Locate all occurrences of a filespec on a drive

 

FT_WHEREIS

FT_WHEREIS()
 Locate all occurrences of a filespec on a drive

 Syntax

     FT_WHEREIS( [ <cDrive:> ][ <cFilespec> ] ) -> aFiles

 Arguments

    <cDrive:> is an optional drive to search.  If omitted, FT_WHEREIS()
    defaults to the current drive.

    <cFilespec> is a DOS legal filespec containing the pattern that
    you want found.  The wildcard characters "*" and "?" are supported.
    If no <cFilespec> is specified, FT_WHEREIS() defaults to all files.

 Returns

    An array of filenames that match <cFilespec>.

 Description

    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.

    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.

 Examples

    /* Example 1 */
    aComSpec := FT_WHEREIS( "command.com" ) // aComSpec now contains an
                                            // entry for every "Command.com"
                                            // on the current drive
    /* Example 2 */
    aBat := FT_WHEREIS( "a:*.bat" )

    IF Empty( aBat )
       ?"Please make sure the proper diskette is in drive A:, and that"
       ?"the drive door is closed."
    ELSE
       ? "You have " + Len( aBat ) " batch files on drive A:"
    ENDIF

 Source: WHEREIS.PRG

 Author: Steve Larsen

See Also: FT_TREE() FT_ORIGIN()



FT_TREE

FT_TREE()
 Locate all directories and subdirectories on a drive

 Syntax

     FT_TREE( [ <cDrive:> ] ) -> aDirectories

 Arguments

    <cDrive:> is an optional drive to search.  If omitted, FT_TREE()
    defaults to the current drive.

 Returns

    An array containing the name of each directory found on the specified
    drive.

 Description

    Use FT_TREE() to obtain an array of the directory structure of a
    specified drive.

    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.

    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().

 Examples

    // list all directories on the current drive
    aTree := FT_TREE()
    Aeval( aTree, {|e| Qout(e) } )

 Source: WHEREIS.PRG

 Author: Steve Larsen

See Also: FT_WHEREIS() FT_ORIGIN()

 

FT_ORIGIN

 FT_ORIGIN()
 Report the drive, path and filename of the current program

 Syntax

     FT_ORIGIN() -> cString

 Arguments

    None

 Returns

    A string containing the full drive/directory/filename of
    the currently executing file.

 Description

    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.

    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.

    Requires DOS v3.xx and above.

 Examples

    cMyFile := FT_ORIGIN()

    IF cMyFile <> "C:\APPDIR\MYFILE.EXE"
       ?"Incorrect startup file.  Please remove/rename and start again"
       QUIT
    ENDIF

 Header File: extend.h

 Source: ORIGIN.C

 Author: Steve Larsen

See Also: FT_WHEREIS() FT_TREE()

 

FT_EXIST

FT_EXIST()
 Test for drive and/or subdir on SINGLE-USER systems only.

 Syntax

      FT_EXIST( <cDriveDir> ) -> lResult

 Arguments

     <cDriveDir> is a character string containing drive spec (with colon)
     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, the current drive is tested.

 Returns

     <lResult>  as logical -
     .T. if drive exists, or subdirectory exists on specified drive
     .F. if drive or subdirectory does not exist

 Description

     FT_Exist() tests for the existence of a drive and/or subdirectory...
     on single-user systems ONLY.  You may get correct results on some
     networks under certain conditions, but this function is not capable
     of working reliably on networks.

 Examples

    IF FT_EXIST( "D:" )
       Qout("OK To Perform Operation On Drive D:")
    ENDIF

 Source: EXIST.PRG