function / user function existing

Prev Next

Function Names

function existing, user function existing

Synopsis

... function existing ( function name )

Description

Checks if the procedure function is existing. user function existing returns true only if the specified function name refers to an existing user procedure or function.

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
string Name of existing user function

Any string can be specified here

Return value

TypeDescription
boolean returned value

true if procedure or function (or user procedure or function) is existing

Examples

               define procedure (foo) { echo( Fool ); };

               echo("Test if existing:");
               echo("  foo : ", function existing( foo )); // user defined
               echo("  bar : ", function existing( bar )); // not existing
               echo("  abs : ", function existing( abs )); // existing
               echo(new line, "Test if user function:");
               echo("  foo : ", user function existing( foo )); // user defined
               echo("  bar : ", user function existing( bar )); // not existing
               echo("  abs : ", user function existing( abs )); // existing

Output

Test if existing:
  foo : true
  bar : false
  abs : true

Test if user function:
  foo : true
  bar : false
  abs : false
Try it yourself: Open LIB_Function_function_existing.b4p in B4P_Examples.zip. Decompress before use.

See also

additional function names