
PRO
dbeard
USA
Asked

I have created a file by downloading data from the web.
this is the line of code
FileWrite($DataFile,HTTPGet($url1))
Where $DataFile is the file location on my harddrive and url1 is the where the data is on the web.
The data gets successfully wrote to the hard drive.
Now my next line of code is $line = FileReadLine($DataFile).
The first line of the Data file is: <!DOCTYPE html>
This fails with the error Input string was not in a correct format.
Now this used to work but with ARC this fails.
What format should the Datafile be in for this to continue?
Related Hardware EZ-B v4
This is the html content:
Red is the "begin text" and Blue is the end
special attention to substring method: https://www.w3schools.com/jsref/jsref_substring.asp
Definition and Usage The substring() method extracts the characters from a string, between two specified indices, and returns the new sub string.
This method extracts the characters in a string between "start" and "end", not including "end" itself.
What bugs are you noticing with the File class? And what version of ARC are you using? (latest?)
weird stuff going on, maybe is a consequence of a single bug. I'll post simple code to demo the issue.
first time (file does not exist)
Close ARC, Open ARC run the script:
Q: without a close and explicit open how you control reads and writes ?
Locks the file, and you need to close ARC.
Reading from a File locks the file too so you need to close ARC.
PTP
In your answer in #16. I think I follow but what I cant figure out is why doesn't your code download all the questions. Why does it stop after 9.
I don't see anything in your code that says just show the first 9 questions.