|
Hi Jon,
Seems to me that you still have to set the string to it's maximum length
before calling rdline() and set it back to the correct length after
calling rdline().
So you can't eliminate all that code. The only thing you can do is
change %addr(var)+VARPREF into %addr(var:*data). You can't eliminate
the rest like you suggested.
Jon Paris wrote:
Just to get the complete picture in place for the archives ...
If using V6R1 (or 6.1 as it is now known) the easiest way to handle
the data portion of a variable length field by address is to code
using %Addr( fieldName: *Data) which will automagically skip the first
two or four bytes as appropriate. So these:two lines
%len(Input_String) = %size(Input_String)-VARPREF (VAPREF is 2)
Len = RdLine( cli : %addr(Input_String) + VARPREF :
%len(Input_String) :
*On );
Can be simplified to one - and of course the constant VARPREF is not
required either.
Len = RdLine( cli : %addr(Input_String: *Data): %len(Input_String) :
Jon Paris
www.Partner400.com
www.SystemiDeveloper.com
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
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.