<<

Contents

Search

>>

 

DEACTIVATE

 

 

Function

 

 

Syntax:

DEACTIVATE(<Menu Item>)

 

<Menu Item> = <STRING-EXPRESSION>

 

Meaning:

With DEACTIVATE single menu items or menu branches can be disabled. <Menu item> = "" refers to the whole menu. DEACTIVATE returns the value 0, if the menu item could be deactivated, otherwise it returns the error number 6001: menu item not found.

 

If the menu item is a checkbox, an asterix can be put before the number in order to set the checkbox.

 

Parameter:

Menu Item

Number of Menu Item

 

Sample:

H% = ADD_MENU("1","&Print;&Bell;&Deactivate;&Activate",MEN.MACRO)

H% = ACTIVATE("*1.1") /* Create checkbox "Print", checkbox is selected

H% = ACTIVATE("*1.2") /* Create checkbox "Bell", checkbox is selected

PRINTING% = 1

...

 

Macro MEN.MACRO:

 

CASE EBUS_MENU$

  OF "Print"     

 

 

  OF "*Print"   

 

 

  OF "Bell"      

 

 

  OF "*Bell"     

 

 

  OF "Deactivate"

 

 

 

 

  OF "Activate"

 

 

...

ENDCASE

 

H% = ACTIVATE("*1.1")

PRINTING% = 1

 

H% = ACTIVATE("1.1")

PRINTING% = 0

 

H% = ACTIVATE("*1.2")

ENABLE BELL

 

H% = ACTIVATE("1.2")

DISABLE BELL

 

IF PRINTING% = 1

THEN H% = DEACTIVATE("*1.1")

ELSE H% = DEACTIVATE("1.1")

ENDIF

 

IF PRINTING% = 1

THEN H% = ACTIVATE("*1.1")

ELSE H% = ACTIVATE("1.1")

ENDIF

 

 

/* select checkbox

/* printing is possible

 

/* unselect checkbox

/* printing is not possible

 

/* select checkbox

/* enable bell

 

/* unselect checkbox

/* disable bell

 

/* deactivate menu item

/* "Print"

 

 

 

 

/* activate menu item

/* "Print"

 

 

See also:

ACTIVATE

ADD_MENU

START_MENU

EBUS_MENU$