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


  • Subject: Opdesc question
  • From: "David Morris" <dmorris@xxxxxxxxxxxxx>
  • Date: Tue, 28 Dec 1999 17:32:58 -0700

Group,

A couple of years ago, I created some procedures that used operational 
descriptors to retrieve the length of *VARSIZE parameters. These parameters 
were also defined as CONST.  Since VARYING length strings became available, 
I have been using VARYING in most cases.  I also found out that passing a 
varying field to a procedure that received a *VARSIZE CONST parameter worked 
just fine... at least I thought it was OK.  I had a program receive an error 
that has not 
been modified for some time.  The error was caused because the operational 
descriptor for the field said the length received was 32768, where the length 
of the 
varying string passed was 1.  The *VARSIZE field was defined as 2048, and the 
caller was defined as 10 VARYING.  The problem appears to be caused when the 
field being passed is the return value of another procedure.  Built-in and 
stand 
alone fields do not appear to have any problems.

Here is a snippet of code that represents the problem situation:

D Proc1       PR          10a  VARYING

D Proc 2      PR
D   Input                         2048a  OPTIONS(*VARSIZE) CONST

C                     CALLP  Proc2(Proc1) 

Should this work?  The manual does not say otherwise, and as far as I can tell 
it used to work.  We did apply some RPG PTF a few days ago, but they do not 
mention either OPDESC, or VARYING.  It is possible that this has never worked 
and CEEDOD has been returning a valid value by chance.

David Morris




+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.