"script"

Gets or sets the event script of a shape.

Synopsis

getValue( string shape, "script", string name, string &source);

setValue( string shape, "script", string name, string source);

shape.script( string name, string source);

Parameters

Parameter Description
name Name of the event which shall be get/set.
source Source code of the script

Description

The function "script" allows to get or set the script of a shape event inside a control script. To get all available events for the shape, the function "scriptNames" can be used

Example

Following example sets the script "main(){DebugN(\"Hello world!\");}" to the "leftClick" event of the button PUSH_BUTTON1.

main()
{
  string source;
  setValue("PUSH_BUTTON1", "script", "leftClick", "main(){DebugN(\"Hello world!\");}");
  DebugN(source);
}

Assignment

All widgets