What is the value of String Length Out following execution of the VI?
NOTE: Assume a Windows system and that no errors are generated by the VI?
File pointer needs to be set to start of file to read
I'm new and it's the first time I write, so excuse me for my english.I don't understand because the Read from Text File function returns
an empty string if I don't set to start of file to read (I suppose with Set File Position function).Since count is -1, it should return all the string as output;
obviously I'm wrong, but why?
When you tell the Read From Text File to read a count of -1, it will read all of the data starting at the current file pointer. In this case, the file pointer is at the end of the file due to the Write To Text File moving the file pointer as it writes.
All right, I looked for it in the LaVIEW Help, but I didn't find anything about the pointer.Thank you crossrulz; my doubt was between A and B answer, but now I know the reason because is A.
Answer: A. Nice one all.
This question is a little bit mean , but an important aspect of file access.
AlexBY makes a good point, the impact of File Position is not all that clear in the LabVIEW Help. These links are a good starting point. Write to Text File, Set File Position, Read from Text File
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.