
ptp
USA
Asked
— Edited

Tested with the last version and the previous version
The following code: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.
Code:
To find the length just add up the length of all the values in the array.
Code:
Hope that helps.
Thanks for that info, after a few hours struggling i didnt expected to be the expected behavior.
I imagine someone writing you need to do tutorial abc or is a bug.
if is true the string is broken, it will be impossible to parse multi line contents/buffers.
Also does not make sense a function filereadall when you can only do filereadline.
no where is explaining the string only handles a single line.
this time i really think there is a learning tutorial missing:
"scripting cookbook / tricks"
Checking old project now.
The one i used for testing has two lines.
If a RegEx is used some other characters like () are a problem too.
*EDIT*: No problem with )
I'll close the ticket.
====
Resolution:
not supported/By Design.
====
Regex: write once, read never...
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.
I'll have to create a second version of file commands for that.