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



On 1/6/2015 12:29 PM, Jack Tucky wrote:

I tried to code the PR/PI in my first RPG and it says I can't return a
value. Do I need something different? Sorry I'm so vague. I'm still not
where I need to be on procedures/service programs, etc.

In order to return a value, you need to tell the procedure interface
(and prototype) that. Here is an example of a procedure that takes a 10
character 'date' and converts it into an 8 digit number. The place
where we define what gets returned is on the PI spec; here it's '8s 0'.
The actual /value/ that gets returned is in the return statement (here,
unimaginatively called retVal).

* convert 'yyyy-mm-dd' to yyyymmdd
p date10to8 b
d date10to8 pi 8s 0
d date10 10a const
...
d retVal s 8s 0 inz
...
return retVal;
p e

You'd do something similar with your 'return the next number' procedure.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.