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



It seems I have run into a little bit of trouble with trying to get the
pointer of a program.  I have a *PGM called RECSHPNOT that I am trying to
obtain a pointer to so I can call it dynamically.  
- I can obtain the system pointer just fine with RslvSp.  
- The activation mark comes back successfully when I use QleActBndPgm while
specifying the system pointer from previous step.
- When I call the QleGetExp with the activation mark it gives me the below
message.  If I call it without an activation mark it just returns a *Null
pointer.

Message . . . . :   Invalid operation for program.

Cause . . . . . :   The operation requested is not supported for program &1.

  The system supports distinct "models" of program objects. Not all
operations 
  are supported for all models of programs. For example, some program
objects  
  cannot be deactivated.


I looked through all of the information on DSPPGM RECSHPNOT and didn't find
anything that indicated my program RECSHPNOT was "Exported" so I am
wondering if QleGetExp is not the API I should be using because I am
actually trying to get the pointer to a *PGM object

In RECSHPNOT here is how I have prototyped the entry point in case that
helps at all (this is a program with a main line area).

     D RecShpNot...
     D                 Pr
     D  pInputFile                  256A
     D  pOutputFile                 256A

     D RecShpNot...
     D                 PI
     D  ppInputFile                 256A
     D  ppOutputFile                256A 

Any advice?

Aaron Bartell


-----Original Message-----
From: Bartell, Aaron L. (TC) [mailto:ALBartell@xxxxxxxxxxxxxx]
Sent: Monday, August 11, 2003 12:55 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Dynamic call with procedure pointers


Thanks Barbara!  That looks like it is exactly what I need.  Here are the
Reference pages for the archives :

http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/apis/qleact
bp.htm (QleActBndPgm)
http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/apis/qleget
exp.htm (QleGetExp)

I will see if I can wrap these with some service programs and get them back
to the group for anyone else that needs them.

Aaron Bartell

-----Original Message-----
From: Barbara Morris [mailto:bmorris@xxxxxxxxxx]
Sent: Monday, August 11, 2003 11:35 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Dynamic call with procedure pointers


"Bartell, Aaron L. (TC)" wrote:
> 
> >From all of the documentation I have read this morning it looks as though
I
> need to define the procedure's prototype in the calling program at
> compile-time.  Is there any way around this?  I would instead like to go
out
> to a file and get the procedure name during run-time.
> 

Aaron, the prototype is necessary to define the parameters and possible
return value.  You can code a procedure pointer in the EXTPROC keyword,
and set the procedure pointer at runtime.

It sounds like you probably know at compile time the possible names you
might want, so you can set the procedure pointer with %PADDR. If not,
there's a way to get a procedure pointer given a service program and
procedure name - search for QleActBndPgm and QleGetExp.

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

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.