I'm writing a program in Qbasic. I'd like to know how to test if a folder exists.
The idea is:
IF "c:\user\basic\blablabla\" exists (?? how to programm the "exist" test?)
THEN CHDIR "c:\user\basic\blablabla\"
ELSE
MKDIR "c:\user\basic\blablabla\"
CHDIR "c:\user\basic\blablabla\"
ENDIF
I hope i'm clear enough,
thank you very much for your suggestions !
:)
Try changing the directory to blablabla
. If it doesn't exist, there'll be an error. Trap this error and specify an error handling routine.
ON ERROR GOTO doesnotexist
CHDIR "c:\user\basic\blablabla\"
END
doesnotexist:
MKDIR "c:\user\basic\blablabla\"
CHDIR "c:\user\basic\blablabla\"
RESUME NEXT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With