Hi Scott

Thanks for mentioning this - the data-structure-like concept, for me, at least, really comes from using *DEFINED, not *BASED.

I've used *BASED to work through multiple entries in a list API, as someone else mentioned - then the *DEFINED variables are just populated - very cool stuff!


On 5/14/2012 12:26 PM, Scott Klement wrote:
Hiya Folks,

Consider using STG(*DEFINED) fields instead of *BASED for this type of
logic. No need to do pointer math that way, and aside from the pointer
stuff, they work the same as *BASED. Save *BASED for times when you
need to be able to change the address in memory where the variables point.

As for Joel's initial question, a *MSGF/RTVMSG might be an easier
solution. But, ultimately, the problem is that CL just isn't that good
at string manipulation. Using a better language like RPG or REXX would
almost certainly work better. Why force a square peg through a round hole?


On 5/14/2012 9:49 AM, DrFranken wrote:
I'm going to guess no, but in some cases you might be able to simplify
by declaring&P_CLIENT,&P_SEQ etc as *BASED fields of a longer
character variable thus building the VALUES( clause there. It could
look as simple as VALUES(&VALUES) avoiding all those *cats in your program.

This thread ...


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

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