setValue()

The function setValue() sets any number of graphics attributes of a graphics object.

Synopsis

int setValue (string shape, string attribute1, <type1_1> par1_1 [, <type1_2> par1_2 ...] [, string attribute2, <type2_1> par2_1 [, <type2_2> par2_2 ...]]);

Parameters

Parameter Description
shape Name of the graphics object as it can be specified in the attribute editor. " " (empty string) addresses its own object
attribute1 Name of the basic attribute
par1_1 Parameters that describe the graphics attribute. The number of parameters depends on the graphics attribute

Return value

setValue() returns 0, in the event of a failure returns -1.

Errors

missing/incorrect arguments

Description

The function setValue() sets any number of graphics attribute of a graphics object. setValue() returns 0, if unsuccessful -1.

  • To perform a setValue into a module it is necessary to use following syntax for the shape string: ModuleName.PanelName:ShapeName

  • If "size"; is the attribute, each parameter for size specification (width and height) must have the size of at least 2 pixels.

Example

main()
{
  setValue("", "foreCol", "red");
}

Setting the border color of own object to red-green blinking, with a clock rate of ¼ second.

setValue("", "foreCol", "<[100,0,0],2,[0,100,0],2, [0,0,0],0,[0,0,0],0,[0,0,0],0,[0,0,0],0>");

Setting the reference point of the object Pump12 to the coordinates (100,200), its visibility to "TRUE".

setValue("Pump12", "position", 100, 200, "visible", TRUE);

setValue() begins with the interpretation of the attributes and parameters at the end of the bracketed expression!

In the case of

setValue("ListofOptions", "appendItem", "something", "bottomPos", 0);

the penultimate entry can be seen in the last line in the list, after

setValue("bottomPos", 0, "ListOfOptions", "appendItem", "something");

"something" is in the last line.

Assignment

Graphics

Availability

UI