Skip to content

_disable

bergsma edited this page Sep 26, 2014 · 5 revisions

#disable

###Disable a method from receive incoming event or query messages.

Syntax

status = disable method ;

Arguments

  1. list method

Any variable that has a defined method.

Return Value

str status
  • $ACKNOWLEDGE : The method was disabled.

The STATUS variable is set to $ACKNOWLEDGE

  • %UNDEFINED : Method 'name' is not a variable.

The STATUS variable is set to %UNDEFINED

  • %BRANCH : Could not find 'method'.

The STATUS variable is set to %BRANCH

Warnings

  • %UNDEFINED : Method 'name' is not a variable.
  • %BRANCH : Could not find 'method'.

Exceptions

  • %ARGUMENT: Invalid arguments. Usage: status = disable method ;

  • %IDENTIFIER: 'variable' argument is not a valid identifier, literal, or reference

Description

An enabled method is available for execution by EVENT or QUERY messages. The disable method is used to prevent the method from being invoked by incoming EVENT or QUERY messages. All methods are disabled by default.

/*--Example 1 -------------------------------*/
connect() {
  /* Received connect message from sender.
     .
     .
     . */

  return ;
}

/* Enable the connect method */
enable ( connect );

/* Enter IDLE state and wait for connect message */
idle();


/*--Example 2 -------------------------------*/

on_message CHECK_MESSAGE() ;
.
.
.
CHECK_MESSAGE()
{
  /* If the incoming method is MYMETHOD, don't execute it */
   if ( method() == "MYMETHOD" ) disable MYMETHOD :
}

_

_

Examples

puts "Create an example for the function 'enable'" ;

Related Links

enable

Clone this wiki locally