Advertisements
DiskChange
Change the current DOS disk drive
Syntax
DiskChange(<cDrive>) --> lSuccess
Arguments
<cDrive> : specifies the letter of the disk drive to change to
Returns
DiskChange() returns true (.T.) if successful; otherwise, it returns false (.F.).
Examples
? DiskName() // D ? DiskChange() // .F. ? DiskChange( "C" ) // .T. ? DiskName() // C . This example uses DiskChange() to change to drive "D": IF DiskChange("D:") ? "Successfully changed" ELSE ? "Not changed" ENDIF . This example builds a string that contains all currently available drives on your system: PROCEDURE Main() ? DriveList() ? WAIT "EOF DiskChange.prg" RETURN // DiskChange.Main() *˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜ FUNCTION DriveList() LOCAL nDriveNo := 0,; c1Drive := '',; cRetVal := "",; cCurrent := DiskName() FOR nDriveNo := 1 TO 26 c1Drive := CHR( nDriveNo + 64) IF DiskChange( c1Drive ) cRetVal += c1Drive ENDIF NEXT DiskChange( cCurrent ) // Restore current drive RETURN cRetVal // DriveList()
Seealso
DiskName()
Advertisements