|
GKern@xxxxxxxxxxxxxxxx wrote:
I think that's similar to what I ended up doing. Below is the code that works:
1 C Eval String_V = *Blanks 2 C Eval String_V = %TrimR(String) + Ifs_RecEnd + x'00' * Open the IFS file for update and write the updated string... 3 C Eval File1 = OpenIFS(%TrimR(IFS_Filename):'w') 4 C Callp WriteIFSRec(%STR(%ADDR(String_V)):File1) Jerry, the code to handle the string variable works, but it's more convoluted than necessary. Just pass the value you want to write directly on the first parameter to WriteIFSRec. And you don't need your String_V variable at all (at least not here). * Open the IFS file for update and write the updated string... 1 C Eval File1 = OpenIFS(%TrimR(String) + IFs_RecEnd:'w') 2 C Callp WriteIFSRec(%TrimR(String) + Ifs_RecEnd:File1) Your code adds the x'00' manually on your statement 2, and then removes it by using %STR on statement 4. Then the compiler re-adds it when it processes the OPTIONS(*STRING) part of parameter passing. You might as well just let the compiler handle the whole thing. By the way, it's not necessary to initialize a string to *BLANKS before assigning it with EVAL. EVAL replaces the entire value anyway, so setting it to *BLANKS first doesn't really do anything.
As an Amazon Associate we earn from qualifying purchases.
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.