03-15-2023, 05:37 AM
INPUT "Give me a file name =>"; file$
IF _FILEEXISTS(file$) THEN
PRINT "Found that file!"
ELSE
PRINT "File doesn't exist!"
END IF
*********************
If you're looking for a way to check to see if a name is valid, for saving purposes rather than loading, that's something you'd have to write yourself as per the ruleset of what's acceptable for you OS. (Windows is much pickier, for example, than Linux when it comes to valid file name characters.)
IF _FILEEXISTS(file$) THEN
PRINT "Found that file!"
ELSE
PRINT "File doesn't exist!"
END IF
*********************
If you're looking for a way to check to see if a name is valid, for saving purposes rather than loading, that's something you'd have to write yourself as per the ruleset of what's acceptable for you OS. (Windows is much pickier, for example, than Linux when it comes to valid file name characters.)