Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read a text and attribute it to a variable
#2
Does the TEST.BAS exist on the root directory of the C: drive?

Because that's what your program is asking for.

Also check for file existence like this:

Code: (Select All)
myfile$ = "test.bas"
if _fileexists(myfile$) then
'do something with myfile$
else
print "Sorry but "; myfile$; " was not found."
end if

Do not use CLOSE by itself. If you have more than one open file, CLOSE on its own will close all the files which is probably what you don't want. This could consume many minutes in debugging.

Do not hard-code paths to files. If you share the program with somebody who does not use Windows, they will be unable to use the program and will be unwilling to fix it. Especially if they're told to install Wine and use the Windows version of QB64...
Reply


Messages In This Thread
RE: Read a text and attribute it to a variable - by mnrvovrfc - 11-24-2023, 09:13 AM



Users browsing this thread: 9 Guest(s)