× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.