/************************************************************************/ /* File: TSTREFLECT.QRPGLESRC example for use of PROCP4NAME */ /* Copyright (C) 2002 Dieter Bender */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, */ /* Suite 330, Boston, MA 02111-1307 USA */ /* You might find a version at http://www.gnu.org */ /************************************************************************/ H copyright('Dieter Bender 08/2002 ') D*B CRTRPGMOD TSTREFLECT D*B+ DBGVIEW(*SOURCE) D*B+ REPLACE(*YES) D*B CRTPGM TSTREFLECT D*B+ ACTGRP(TSTREFLECT) D*B+ BNDDIR(QC2LE) D*B+ REPLACE(*YES) D*B+ DETAIL(*FULL) D*B+ BNDSRVPGM(PROCP4NAME) /COPY QRPGLEH,PROCP4NAME /*--- local Prototypes D CallPointer S * PROCPTR D ReflectProc PR z EXTPROC(CallPointer) D Work PR /*--- Constants D TRUE C *ON D FALSE C *OFF /*============================================================*/ /*--- very unimportant procedure main ------------------------*/ C C Callp Work C return /*============================================================*/ P Work B D TimeStamp1 S Z D TimeStamp2 S Z /* activate procedure GETTIMESTAMP in SRVPGM GETTIME */ /* and get procedure pointer to activation */ C Eval CallPointer = C GetProcPointer( C 'GETTIME' : C 'GETTIMESTAMP' C ) /* call the procedure with prototype ReflectProc /* prototype is needed to get return value C eval TimeStamp1 = ReflectProc /* call without prototype C callb CallPointer P Work E