findproc
findproc |
Purpose
Check if a zero-argument public procedure with the given name exists
Synopsis
function xreflect~findproc(procname:string):boolean
Argument
procname
|
The name of the procedure to find
|
Return value
If a zero-argument public procedure with the given name is found, true. Otherwise, false.
Example
In the following:
public procedure myproc1 writeln('hello'); end-procedure public procedure myproc2(xyz:string) writeln('world'); end-procedure writeln('findproc(myproc1)=',findproc('myproc1')) writeln('findproc(myproc2)=',findproc('myproc2'))
myproc1 will be found but myproc2 will not be found as it requires an argument. Therefore the example produces this output:
findproc(myproc1)=true findproc(myproc2)=false
Further information
1. If procname is the name of a function, findproc will return false.
2. If procname takes arguments, findproc will return false.
3. If procname is overloaded, findproc will return true if one of the overloads takes no arguments.
Related topics