Jump to content

Check that file exists: Difference between revisions

Line 444:
 
==={{header|Commodore BASIC}}===
Try a file, then check the error status of the disk drive. "Error code 62" is the "File not found" error. The trick is to open the file without specifying the file type (PRG, SEQ, REL, etc.) and the Read/Write mode in the OPEN statement, otherwise you willmay end up with error code 64 "File Type Mismatch".
<lang gwbasic>10 REM CHECK FILE EXISTS
15 ER=0:EM$="":MSG$="FILE EXISTS."
Line 471:
 
ENTER FILENAME TO CHECK? NOFILE.DOC
 
'NOFILE.DOC' IS NOT HERE.</pre>
 
113

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.