Button

Inserts a labeled push button control into the spreadsheet. Optionally, a button press can be configured to signal a spreadsheet event trigger.

Tip: To access the property sheet for a Button, right-click the button and select Edit Function.
Note:
  • A Button control may be controlled programmatically via In-Sight Native Mode commands, using the EV SetCellValue command. Enter a 1 to press the button down, and a 0 to release the button. Ensure that the command to release the button after pressing it is sent, otherwise the button will remain as though it were pressed on.
  • A button click generates two events. The state of the button changes from 0 to 1 when pressing the button down, then from 1 to 0 when releasing the button. If a button is configured to generate a soft event, the event is only triggered once on the down press of the button.

Button Inputs

Syntax: Button(Name,Trigger)

Parameter Description

Name

Specifies a text string label; this name will appear on the button itself.

Trigger

Optionally specifies a trigger signal to occur when the button is pressed.

-1 = none (default)

No trigger will be signaled.

32 = manual

A manual trigger will be signaled.

(80 to 87) = soft (0 to 7)

A soft trigger event will be signaled.

Button Outputs

Returns

A value of 1 when the button is pressed; otherwise the return value is 0.

Results

A labeled Button control.

Button Example

  1. Assume cells A3 and A4 are configured as follows:

    A3=Button("Test",-1)

    A4=Count(A3,9999999,0,0)

    The spreadsheet looks like this:

  2. Press the button in cell A3. Cell A4 references cell A3 to count the number of times the "Test" button is pressed. The value in cell A4 is now 1.000.