Consultor Eletrônico



Kbase 14159: New Method in V8 GET-SIGNATURE Internal procedure info
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
New Method in V8 GET-SIGNATURE Internal procedure info

INTRODUCTION:
=============
This knowledgebase entry discusses the method GET-SIGNATURE.


WHY YOU NEED TO KNOW THIS:
===========================
This method returns more information about a particular internal
procedure. By using this, you will get information about the
parameters for the internal procedure of any running 4GL
procedure.


PROCEDURAL APPROACH:
====================
There will be a new method added to the procedure handle for a 4GL
procedure; it will be called GET-SIGNATURE and will take one
parameter, a character expression giving the name of the
internal procedure or user defined function. It will return a
character string of the following form:
<type>,<return-type>,[<parameter>[,<parameter>]***]
where <type> is one of:
PROCEDURE -- vanilla Progress internal procedure

DLL-ENTRY -- entry point for a DLL
MAIN -- main procedure
<return-type> is empty for PROCEDURE, DLL-ENTRY, and MAIN
and <parameter> has the following format:
<mode> <name> <d_or_btype>
where <mode> is either INPUT, OUTPUT, INPUT-OUTPUT, or BUFFER;
<name> is the parameter name; and
<d_or_btype> is either the table name if its a buffer parameter,
or one of the following:
CHARACTER
INTEGER
DECIMAL
LOGICAL
DATE
RECID
RAW
WIDGET-HANDLE
MEMPTR
ROWID
Note that if there are no parameters, the result string will have
the form:
<ptype>,<return-type>,
that is, the comma will terminate the string; this is in order to
work well with the Progress ENTRY function, which returns the index
of the nth entry given a character string. In particular,
ENTRY(procedurehdl:GET-SIGNATURE("entryname"), 3) will conveniently
give the index into the result of the parameter list.

Examples

Example 1:
PROCEDURE disable_UI:
/* no parameters */
END.

THIS-PROCEDURE:GET-SIGNATURE("disable_UI") returns: PROCEDURE,
Example 2:
PROCEDURE example2:
DEFINE INPUT PARAMETER xyz AS INT.
DEFINE OUTPUT PARAMETER abc AS CHAR.
DEFINE PARAMETER BUFFER custbuf FOR customer.
END PROCEDURE.

THIS-PROCEDURE:GET-SIGNATURE("example2") returns:
PROCEDURE,,INPUT xyz INTEGER,OUTPUT abc CHARACTER,BUFFER

custbuf customer


Example 3:
PROCEDURE example3 EXTERNAL mydll.dll:
DEFINE INPUT PARAMETER hdl AS MEMPTR.
DEFINE RETURN PARAMETER retval AS SHORT. /* maps to INTEGER */

END PROCEDURE.

THIS-PROCEDURE:GET-SIGNATURE("example3") returns:
DLL-ENTRY,,INPUT hdl MEMPTR, OUTPUT retval INTEGER

REFERENCES
==========
Language Reference Volume 2

Progress Software Technical Support Note # 14159