• Subject: RE: Passing a substring as a parm to a proc
  • From: Joel Fritz <JFritz@xxxxxxxxxxxxxxxx>
  • Date: Thu, 1 Jul 1999 09:27:04 -0700

Here's an example that doesn't do much, but it passes a substring to a
procedure and modifies it.  You could liven it up with variables for
substring offset and length.

        *************** Beginning of data
*****************************************************************
0001.00 Ddumstring        pr             5

0002.00 Dstring                          5    value

0005.00 Dlongerstring     s             20    inz('12345678901234567890')

0006.00 C                   eval      %subst(longerstring: 5: 5)  =

0007.00 C                             dumstring(%subst(longerstring: 5: 5))

0041.00 C                   SETON
LR                            
0042.00 Pdumstring        b

0043.00 Ddumstring        pi             5

0044.00 Dstring                          5    value

0045.00 D

0046.00 C                   eval      string = 'newva'

0047.00 C                   return    string

0048.00 Pdumstring        e

        ****************** End of data
********************************************************************

-----Original Message-----
From: JFinney@omnia.co.za [mailto:JFinney@omnia.co.za]
Sent: Thursday, July 01, 1999 7:17 AM
To: RPG400-L@midrange.com
Subject: Passing a substring as a parm to a proc


Hi all
Is there any possible way that I can call a procedure passing a substring
as a parameter ? The substring will ALWAYS be a fixed length, however it
may vary along a character field.
Regards
John.


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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