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



Scott, I think one could avoid the separate setting of variable length. The
change would involve coding:

%Len(String) = RdLine( cli : %addr(Input_String: *Data):
%size(Input_String) :

Instead of
Len = RdLine( cli : %addr(Input_String: *Data): %len(Input_String) :

But I'd need to research whether the %size() variable should actually be
reduced by the length of the length portion.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Most people have some sort of religion, at least they know which church
they're staying away from."
-- John Erskine

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



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.