1. Syntax
         2. CHDRIVE context usage
         3. Examples
        
CHDRIVE Function



1. Syntax:
Rapid-Q Documentation Project (RQDP) Release 01        CHDRIVE
Credits & Contributions: Issues:
William Yu Original Documentation
Stanescu Serban New documents, Project management
Others: Rapid-Q Groups, Yahoo eGroups.
Current Document/Author/Revision/Release chdrive.html/Serban Stanescu/None/01



         CHDRIVE [drivepath]

[drivepath] = String. You have to pass the argument to the function. You have to use CHDRIVE function with caution, since certain drives are removable type. Changing the current drive to a device which has no media inserted, will fail into an error.

2. The CHDRIVE function context usage.


         The CHDRIVE function is used to change the current drive. Useful mainly in applications where you need file manipulation, data exchange on different drives...
         This is supposed to be used with certain precautions, since you may change drive to a removable type, which might not have media inserted. You have to perform the function call, AFTER testing the drive's media. Something like this
        If TestDriveResult("X:")=Failure Then
          TreatErrors TestDriveResult("X:")
        Else
          CHDRIVE "X:"
        End If
         In this example, we used "TreatErrors TestDriveResult("X:")" which is a simultaneous call of 2 functions: TestDriveResult("X":) - where "X:" is any removable type drive as assigned by the system, and TreatErrors- the error trapping routine. We use the second to test the drive, and if we succeed, we pass the result to CHDRIVE, else, we pass the result to the Error trapping function. (I didn't say we have those functions! It's just an example!)
        

3. Examples:


                  CHDRIVE "C:"

         DIM mypath AS String
         '...............................
         mypath=GetMyDrivesPath(...)
         CHDRIVE mypath

'...............................

Up



Index Contents Up   Next page