delete user function

Prev Next

Function Names

delete user function

Synopsis

delete user function ( function name )

Description

Deletes a user-defined procedure or function. Note: Actually, the user-specific function name will be delisted. The underlying code containing the function implementation will not deleted. In case additional function names are defined, then only the affected function name will be deleted.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
string Name of existing user function

Must be a function name defined with define procedure(), define function(), define procedure and function(), define additional procedure(), define additional function(), or define additional procedure and function(), .

Exceptions

User function not found
Specified function is not a user function

Examples

               define procedure (foo)
               {
                       print("Function name = ", function name[],"  " );
                       if (function name[] = bar) echo("Message = ", message[] ); else: echo;
               }

               define additional procedure (bar, foo, { { message, string } } );

               {   // Main part
                       foo;
                       bar(salad bar);
                       delete user function( foo );
                       bar(desert bar);
                       define procedure(foo) { echo (new line, "Fooled."); };
                       foo;
                       bar(wine bar);
                       delete user function (bar);
                       define procedure(bar) { echo (new line, "Bar closed."); };
                       bar;
               }

Output

Function name = foo  
Function name = bar  Message = salad bar
Function name = bar  Message = desert bar

Fooled.
Function name = bar  Message = wine bar

Bar closed.
Try it yourself: Open LIB_Function_delete_user_function.b4p in B4P_Examples.zip. Decompress before use.

See also

user function existing