<<
Thanks for the reply Larry, but your last comment on the subject is the
deal breaker! I am in fact creating a fixed position export file to be used for import
into a main-frame based accounting program.
the (CHAR(160)) will most certainly cause them a problem.
>>
Well, the first thing you need to do is say "Fixed fields? I can't believe you guys are still doing that stuff! Can't I give it to you in XML?" Just to show them who's boss.
As noted, only the last character has to be non-32. It so happens that the padding will survive if a character is added in the same _expression_ as the padding is done. So make sure to set all your fields in a single _expression_. In that way you only need to worry about the last character of the line:
SET VAR vOutline = (LJS(.vField1, 10) + LJS(.vField2, 15) + LJS(. . .
Now, I'm assuming that the records in the output file will be separated by newline (CHAR(13) + CHAR(10)) characters. You can solve your problem by adding the newline characters yourself in the same _expression_, instead of having the WRITE command do it:
SET VAR vOutline = (LJS(.vField1, 10) + . . . + LJS(.vFieldLast, 15) + CHAR(13) + CHAR(10))
Now you have a nice padded variable that will survive will all the spaces. Of course, WRITE will probably add its _own_ set of CRLF to the line, but you can avoid that in R:Base for DOS using the (undocumented) CONTINUE feature:
WRITE .vOutline CONTINUE
This does _not_ work in Windows 7.x (you get the word CONTINUE included in the output). I don't know about Windows 6.5, my guess is that it will work (since that version has more in common with DOS in terms of screen output). Try it. It's also possible, by the way, that WRITE will see the CRLF at the end of you line and not add a second set.
--
Larry
deal breaker! I am in fact creating a fixed position export file to be used for import
into a main-frame based accounting program.
the (CHAR(160)) will most certainly cause them a problem.
>>
Well, the first thing you need to do is say "Fixed fields? I can't believe you guys are still doing that stuff! Can't I give it to you in XML?" Just to show them who's boss.
As noted, only the last character has to be non-32. It so happens that the padding will survive if a character is added in the same _expression_ as the padding is done. So make sure to set all your fields in a single _expression_. In that way you only need to worry about the last character of the line:
SET VAR vOutline = (LJS(.vField1, 10) + LJS(.vField2, 15) + LJS(. . .
Now, I'm assuming that the records in the output file will be separated by newline (CHAR(13) + CHAR(10)) characters. You can solve your problem by adding the newline characters yourself in the same _expression_, instead of having the WRITE command do it:
SET VAR vOutline = (LJS(.vField1, 10) + . . . + LJS(.vFieldLast, 15) + CHAR(13) + CHAR(10))
Now you have a nice padded variable that will survive will all the spaces. Of course, WRITE will probably add its _own_ set of CRLF to the line, but you can avoid that in R:Base for DOS using the (undocumented) CONTINUE feature:
WRITE .vOutline CONTINUE
This does _not_ work in Windows 7.x (you get the word CONTINUE included in the output). I don't know about Windows 6.5, my guess is that it will work (since that version has more in common with DOS in terms of screen output). Try it. It's also possible, by the way, that WRITE will see the CRLF at the end of you line and not add a second set.
--
Larry

