Which is the best way to insert n amount of blank space in text file
ex: 1234_____________5678 (where _ equals the blank space)
I tryed to make a simple loop that takes character and lenght as param and loops the file adding space
FOR i := 1 TO lenght DO BEGIN
Tiedosto.WRITE(char);
Tiedosto.SEEK(Tiedosto.POS-2); // so there will not be new line
END;
The textmode is TRUE..
The loop works fine like with character 0 zero but not with space.
Any help?
K.S.
0
Answers
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
File datatype does not have padstr function?
And if I'd use it on text/code datatype it would not be good either, the space I'd need is around 200 to 400 characters and max variable size on nav was 250?
You can create a text with length 1024 also and while writing the text file, you can use PADSTR function for 200 to 400 characters also..
as per me, this is the best way to do.. :thumbsup:
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
aaah, hmm that'd solve it then. I somehow recalled the text lenght gap was 250 #-o
cheers bud :thumbsup:
The length limit of a field in a table ist 250 CHARs, in old versions (e.g. 2.60) the limit for a variable of type text is 260 CHARs. In newer versions it is 1024 CHARs.
By concatenating text strings in the parameter of WRITE you can write more than 1024 characters at once, but limited by stack space, so I would not stretch this to the limit as in the sample code below. The following works in the RUN trigger of a codeunit in NAV2009: (By the way: here you see an alternative to the PADSTR approach... using FORMAT)