Valid_Drive

See Also: File_Exist, Get_Directory, Make_Directory, Make_Temp_File, Remove_Directory

Purpose

To check if a given drive letter is valid on the system.

Syntax

valid_drive driveName {integer-variable}

It is optional whether the value of driveName ends in a colon (:) or not.

What It Does

Valid_drive returns zero in {integer-variable} if the given driveName is mapped on the system. This command requires two parameters: the drive letter to check and the variable that will contain the return value.

Integer iDriveValid

 

Valid_Drive "K:" iDriveValid

In this example, the integer variable iDriveValid will contain 0 (zero) if K: is a valid drive on the operating system. It will contain -1 if it is not.