+ Reply to Thread
Results 1 to 4 of 4

Thread: using prototyped calls in free-format rpg

  1. #1

    Default using prototyped calls in free-format rpg

    Just use your variable in the EXTPGM keyword. And if you use CALLB with a procedure pointer, specify the proceure pointer in the EXTPROC keyword.

  2. #2

    Default using prototyped calls in free-format rpg

    I'm trying to use free-format rpg in my new developmentand have run into a problem. I was wondering if it's possible to use a variable for the name of the pprototypedcall. The interface is the same for all pgms that will be called via this method. /free callp someVariablePgmName(pString); /end-free Normally I would handle it this way...
    Call pgmVariable pgmPlist
    Any thoughts or comments would be greatly appreciated. Thanks, Brandon

  3. #3

    Default using prototyped calls in free-format rpg

    Thanks Barbara, That worked great for what I was doing in that pgm. How about if I wanted to load a procedure ptr with the address of a procedure that is named in a variable. I'm trying to create a generic service pgm that would be bound to any pgm that would need to call a procedure. My hope is: a. easier maintenance for programming b. dynamic binding occuring at time of procedure call If you couldn't tell, I'm kinda new at ILE programming, but I'm trying... Here's the code that doesn't work since %paddr wants a literal as a parm. h NoMain /Define cpyprocptr /copy qrpglesrc,prototypes *================================================= =============== * Return a pointer to a procedure that is input *================================================= =============== p GetProcPtr b Export d GetProcPtr pi * d procName 30 value
    Return %paddr(procName)
    p GetProcPtr e

  4. #4

    Default using prototyped calls in free-format rpg

    That's not so easy. If you know the possible values when you're writing your program, the easy way is to use a SELECT statement. C select C when name = 'A' C eval pptr = %PADDR('A') Otherwise, as long as the procedure is in a service program, there's a way to get the procedure pointer just from the names of the service program and procedures, using system APIs QleActBndPgm, QleGetExp, and rslvsp. Look here for an example http://www.iseriesnetwork.com/Resour...erpgmodule.htm.

+ Reply to Thread

Similar Threads

  1. RPG free format information
    By M.Lee in forum General
    Replies: 7
    Last Post: 01-06-2005, 09:33 AM
  2. Free Format
    By Guest.Visitor in forum General
    Replies: 2
    Last Post: 05-23-2004, 12:50 PM
  3. Free format
    By sanjivtannu@yahoo.com in forum RPG
    Replies: 1
    Last Post: 05-21-2004, 12:42 PM
  4. Free-Format Woes
    By Guest.Visitor in forum RPG
    Replies: 8
    Last Post: 03-23-2004, 11:32 AM
  5. /free (free format on ILE)
    By Guest.Visitor in forum RPG
    Replies: 2
    Last Post: 05-06-2002, 11:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts