Link to home
Start Free TrialLog in
Avatar of b001
b001Flag for Afghanistan

asked on

write to usb drive

Hi Experts

I use the following code to pick a usb drive letter and try to write to it.
But it crashes with this error if that drive is not available, because my machine displays all the removed usb drives as well.

EXCEPTION PROCESSED
C00000013 Parameters 75bbbf7c  etc
MY code;

drivedirx = GETDIR()
backup_drivelx = drivedirx
drive_statxa = 'N'
TRY
      Set Safety Off
      Create Table Alltrim(LEFT(drivedirx,1))+':\TEMPback1' Free;
            (ICODE C(15),SELLING N(10,2),QTY N(10),IDESC C(30);
            ,CPRICE N(10,2),suplier C(15),CAT C(10);
            ,minqty N(10),sel_REC l,DEL_REC C(1))
      Set Safety On
      Store 'Y' To drive_statxa
Catch
      Store 'N' To drive_statxa
Endtry

PLEASE HELP

thanks
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Which command crashes? GETDIR() or CRATE TABLE ?

If it is GETDIR() then we can do nothing probably except of using different method to retrieve and display the list of drive letters.

If CREATE TABLE crashes then you have to test the drive existence before this command.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial