Hi All,
Probably a really simple question but does anyone know of any method that is built into Navision that deals with reading lines froma file in an easy way. I'm not a seasoned Navision programmer and I'm a little lost.
I'm looking for a method that will allow me to read separate lines from a file. I've tried f.READ however that appears only to return the entire contents of the file.
For example my test file consists of the following...
1,4556667,56
3,4787678,65
3,5564333,67
If I output the "line" that I've read in from this file I get the entire contents. I've looked at f.TEXTMODE which I presume should be set to true (based on my past experience of file output with Navision to avoid binary type files/no end of line).
This is my test code...
IF EXISTS('filename.txt') THEN BEGIN
importFile.OPEN('filename.txt');
WHILE importFile.POS < importFile.LEN DO BEGIN
importFile.READ(in_line);
MESSAGE(in_line);
END;
END
ELSE
MESSAGE('The import file does not exist');
The output from this simply relays the entire contents of the file back through a message box; however what I am aiming for is for each line to be read separately. Any help would be appreciated.
Comments
http://kb.iu.edu/data/acux.html
Is there any other reason why this would fail? When I use
I get the total number of characters in the file. I assume that this should report back the number of characters that is within the line that has been read (in_line). If this was the case then that would be a lot less than what is currently being returned.
Thanks in advance
EDIT
=============================
Solved....
I had been messing with the code when i had a free moment and realised that I has set textmode on my output file but not on my input #-o
=============================
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!