Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read and write variables to/from a file.
#3
If you're set on using a file to do it, this should work.
Code:
Copy      Help
str temp

if(FileExists("%USERPROFILE%\Desktop\test.txt"))     ;; check if file exists
,temp.getfile("%USERPROFILE%\Desktop\test.txt")     ;; stores contents of file to string 'temp'.
,temp=val(temp)+1     ;; evaluate string 'temp' as integer and increment by one.
else
,temp=1     ;; if file does not exist, set # of runs to 1.
temp.setfile("%USERPROFILE%\Desktop\test.txt")     ;; write string 'temp' to file.


Messages In This Thread
RE: How to read and write variables to/from a file. - by sirpipthegreat - 04-11-2019, 05:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)