: To get a string from a text file -
: First, have the file open of course:
:
: OPEN "filename.txt" for input as #1
:
: Filename.txt should be replaced with whatever the filename is
:
: Then, to input, read in lines of text into a string variable:
:
: line input #1, a$
:
: This will get one line from the file into a$. To print it out to the screen as an integer:
:
: print val(int(a$))
:
: You can omit int and just use val(a$), but then it wont necessarily be an integer. could be floating point, etc.
:
: : I'm making this program that requires taking a number from a file and using it in the program. Is there anyway i can take an integer from a file? How can a change that number in the file to an integer?
: :
: : Thanks for everyones help
: :
:
:
You have val and int reversed. An oversight I'm sure. Should be:
print int(val(a$))
rg