Arbitrary File Access: Type Text: R/W int, float, etc.
Posted: Mon 18. Oct 2010, 20:30
OBJECTIVE: Use a "control" file containing parameter settings which is read by a script and used to automate a MemBrain run. Things like Step Size, Error Target, Export File Name, Network Name, etc. would be contained in this Control File.
PROBLEM is: I can't seem to I/O numbers from a text file.
The Read (string) works as expected but What am I missing when I try to Read or Write (int) or (float)? (It seems like the commands work OK for binary files.)
ASSUMING that numbers can be I/O'd only from Binaries and Strings can only be I/O'd from Text Files, it sounds like it is impossible to I/O from files that have both numbers and strings? Is this true?
If YES, then to handle such a file (mixed mode lets call it), one must read the line as a string and parse out the numbers?
While not too bad a job in Delphi, in AngelScript, there don't seem to be any StrToFloat or IntToStr functions which means to get the numbers into and out of the string, the numbers must be built/read one character at a time. If this is true, then its too difficult.
Thanks
Tom
PROBLEM is: I can't seem to I/O numbers from a text file.
The Read (string) works as expected but What am I missing when I try to Read or Write (int) or (float)? (It seems like the commands work OK for binary files.)
ASSUMING that numbers can be I/O'd only from Binaries and Strings can only be I/O'd from Text Files, it sounds like it is impossible to I/O from files that have both numbers and strings? Is this true?
If YES, then to handle such a file (mixed mode lets call it), one must read the line as a string and parse out the numbers?
While not too bad a job in Delphi, in AngelScript, there don't seem to be any StrToFloat or IntToStr functions which means to get the numbers into and out of the string, the numbers must be built/read one character at a time. If this is true, then its too difficult.
Thanks
Tom