This example allows the user to select a new current drive and uses ChDrive to make their choice the new current drive.
Const crlf$ = Chr$(13) + Chr$(10)
Sub Main()
????Dim d()
????old$ = FileParse$(CurDir,1)
????DiskDrives d
Again:
????r = SelectBox("Available Drives","Select new current drive:",d)
????On Error Goto Error_Trap
????If r <> -1 Then ChDrive d??
????MsgBox "Old Current Drive: " & old$ & crlf & "New Current Drive: " & CurDir
????End
Error_Trap:
????MsgBox Error(err)
????Resume Again
End Sub
|