procedureexists(
DATABASE
,
PROCEDURE
)

The procedureexists( function checks to see whether a procedure exists or not.


Parameters

This function has two parameters:

database – The database that contains the procedure you want information about, or "" for the current database (or can be omitted entirely).

procedure – The name of the procedure you want to check for existence.


Description

This function checks to see whether a procedure exists or not. This function works even if the code author does not have the authorization to examine the database structure (so they cannot see a list of procedures).

Here is a simple exmple that checks to see if an .IntializeMenu procedure exists, and if so, calls it.

 if procedureexixts(".InitializeMenu")
    call .InitializeMenu
 dndif

This function can also be used to check if a procedure exists in another open database.

 if procedureexists("Contacta","dialphone")
     farcall "Contacts","dialphone","555-1212"
 endif

Note that if the Contacts database isn’t open, this code will stop with an error. A well placed catcherror( function can cure that problem.

if catcherror(false(),procedureexists("Contacta","dialphone"))
    farcall "Contacts","dialphone","555-1212"
endif

This code will not fail even if the Contacts database is not open.


See Also


History

VersionStatusNotes
10.2NewThis function is new in this version.