01-26-2006 10:00 AM
01-26-2006 11:31 PM
Well, it seems that your problem is related to how you update your line rather than to file writing. Basically WriteLine adds a end-of-line character at the end of the string before writing it to the file, so in my opinion you are not preparing correctly the string to write down. How are you updating the line?
You could put a breakpoint in your code immediately before witing to the file and look at the line content to detect if it is correct or not.
01-27-2006 02:07 AM
index = FindPattern (readingline, 0, -1, "NS1(", 0, 0);
if (index == 0)
{
SetFilePtr (file_handle, -(numreadingline + 1), 1);
main_str = "NS(789),\0";
WriteFile (file_handle, main_str, StringLength(main_str));
break;
}
01-27-2006 02:12 AM
01-27-2006 02:23 AM
Hello,
If alos the '\0' character should be written, your code should be:
WriteFile (file_handle, main_str, StringLength(main_str+1));
According to StringLength help, StringLength returns the number of bytes in the string up to, but not including, the first ASCII NUL.
01-27-2006 02:24 AM
Sorry, that should have been
WriteFile (file_handle, main_str, StringLength(main_str)+1);
01-27-2006 03:12 AM - edited 01-27-2006 03:12 AM
Message Edited by Roberto Bozzolo on 01-27-2006 10:17 AM