USA
Asked — Edited
Resolved Resolved by DJ Sures!

Filereadall Stops Working

Tested with the last version and the previous version

The following code:


1: ClearVariables()
2: $test1 = FileReadAll("c:\dev\test.txt")
3: FileReadClose("c:\dev\test.txt")
4: Print(Length($test1))

Generates an error:

Quote:

Error on line 4: Missing String Quotes or Invalid Expression at index 0: "hello

the "hello" is inside the file, not in the code.


ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

PRO
USA
#9  

if the content of the file has a "(" the error is:

Quote:

Error on line 4: Missing ) in Expression

I didn't check other combinations but if there is a RegEx involved,

i'm not a fan of regular expressions, although they are very useful.

PRO
Synthiam
#10  

oh - reading from a file - yeah. i will have to add a new function. A while ago there was a request to read code from a file with functions. This was implemented a long time ago but a function that reads which doesn't execute the function can be created.

I'll have to create a second version of file commands for that.