| System Functions |
|
| Format | DIR(disk_id[$][,ERR=stmtref]) Where: |
|||
| disk_id[$] | Disk to check. String or numeric expression. | |||
| stmtref | Program line number or statement label to which to transfer control. | |||
| Returns | String, name of current directory. | |||
| *Note* | This function is primarily for use in PVX Windows/DOS. Under UNIX, ProvideX assumes that there is only one disk drive and this function only returns the current directory. | |||
| Description | The DIR( ) function returns a string naming the current directory for the disk drive specified. Use either a string or numeric value to specify the drive. If a string is given, the first character indicates the drive (A, B, C and so on). A null ("") string returns the name of the current directory for the current drive. If a numeric value is given, it must be an integer in a positive range starting at zero. A value of zero (0) indicates the first drive, 1 the second ... When reporting items based on the universal naming convention, this function returns the UNC-style pathname; i.e., for a current directory of \\server\share\path\ DIR( ) returns \path\. |
|||
| Examples | The following illustrates use of the DIR( ) function in a Windows environment. 0100 PRINT "Available Drives by Drive Number" 0110 FOR X=0 TO 25 ! Check for Drives 0 to 25 |
|||
| 0120 LET A$=DIR(X,ERR=*NEXT); PRINT STR(X)," | ",A$ | |||
| 0130 NEXT X 0200 PRINT "Available Drives by Drive Letter" 0210 FOR X=65 TO 90 ! Check for Drives A to Z |
||||
| 0220 LET A$=DIR(CHR(X),ERR=*NEXT); PRINT CHR(X)," | ",A$ | |||
| 0230 NEXT X ->run Available Drives by Drive Number 0 \ 2 \PVX\ 3 \WIN9X\ 6 \bestlogos\ 7 \ Available Drives by Drive Letter A \ C \PVX\ D \WIN9X\ G \bestlogos\ H \ |
||||