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



Hello

First thought is, did the problem occur with the older version of the program when you ran it in 6.1? There is a conversion to a new internal structure for programs and service programs.

I would definitely declare the parameter with LIKEDS. I might even go so far as to have the DS defined with the TEMPLATE keyword, then use LIKEDS even for the DS you pass.

You probably know that if you leave off the VALUE keyword, that you ARE passing the address of the DS. Before we had LIKEDS, we had to use the pointer technique or use LIKE and copy the parameter into a real DS. The latter is also safer, I think, than the pointer technique.

Maybe the main issue with using pointers this way is, you lose data-type checking, which could really help you here.

Hope this helps
Vern

On 3/6/2012 5:57 AM, PAPWORTH Paul wrote:
Since we installed Version of the RPG compiler with the attribute o/s current we have been encountering problems with a technique that previously worked ok.



Module créé en édition . . . . . . . . . . . . : V6R1M0

Module créé pour édition . . . . . . . . . . . : V6R1M0



With the third parameter we pass the address to a data structure :-



wrkCRtn = cpReadI( XmoYAccVal : XmoCValeur

: %addr(vlxopc) )







In the called function we do the following



PcpRead B Export



d Pi Like( Tint )

d ii_YAcc 1 Value

d ii_CVal 12 Value

d PtrVlXOpc Like( TPointer ) Value

d Options( *NoPass )









d vlxopc e ds extname(dvlxopc)

d Based(PtrVlxOpc)





Has anybody had problems with this technique ?



Yesterday I got a messages that an objet had been partially or entirely destroyed and could not be used followed by a recursion exception !!



I recompile the program and it now works ! I suppose the allocation of memory may be a bit different and as such the (I suspect) pointer error no longer occurs.



I am thinking of identifying and where possible replacing this technique ( %addr ) by passing the ds itself.





I did read a comment my Hans Boldt that this technique should be avoided. I should perhaps leave the use of this technique for use with API access only.



What do you all think














As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.