|
I inadvertently left out the second open statement on my original email.
Also the StringVal field really should have been named StringValW with a
carriage return concatenated at the end. I was in a bit of a rush when I
sent it and didn't proof it well enough.
> StringVal = 'LINE 1 ';
> StringValW = %TrimR(StringVal) + CRLF;
> Fd=write(RC2:%addr(stringvalW):%Len(%Trim(stringvalW)));
RC2=open(TempStmfFile:O_CREAT+O_WRONLY+O_CODEPAGE
:S_IWUSR
:819);
Closef(RC2);
OpenFlag2 = O_WRONLY+O_TEXTDATA;
RC2 = Open(TempStmfFile:OpenFlag2);
StringValW = %TrimR(StringVal) + CRLF;
Fd=write(RC2:%addr(stringvalW):%Len(%Trim(stringvalW)));
I found out what was wrong. As Booth pointed out I was originally
trimming the remaining spaces and then concatenating the carriage
return. When I was writing the records to the file I was trimming the
whole field to get the length. Anytime the StringValW had leading blanks
the result for %Len(%Trim(StringValW)) was too small.
Thanks everyone.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.