iDevOS CALC "PIXY" Command
Get the height of an entity.
Description
CALC( y, name, "PIXY" ); // y = height("name") CALC( y, name, a, "PIXY" ); // y = height("name") + a
This command returns the value y
which is the display height of the entity name
and adds a
, if provided.
Text, image, draw, touch key and page entities have sizes. Other entities, such as variables, do not and will return 0
for their size.
The width of an entity can be obtained using "PIXX"
.
Parameters
y
- Calculation result.
Parameter type: entity name of a numeric variable (egU8
,S32
,FLT3
etc). name
- Entity Name.
Parameter type: Immediate entity name. a
- Input value.
Parameter type: immediate number, or entity name of a numeric variable (egU8
,S32
,FLT3
etc). "PIXY"
- CALC command operator.
Parameter type: immediate string.
Examples
Example 1
VAR(width, 0, S32); // Result variable VAR(height, 0, S32); // Result variable DRAW(box, 20, 30, stBox); // Create a rectangle CALC(width, box, "PIXX"); // width = 20 CALC(height, box, "PIXY"); // height = 30 CALC(width, box, 10, "PIXX"); // width = 30 CALC(height, box, 10, "PIXY"); // height = 40