iDevOS CALC "POSY" Command
Get the Y position of an entity.
Description
CALC( y, page, name, "POSY" ); // y = posy("name" on "page") CALC( y, page, name, a, "POSY" ); // y = posy("name" on "page") + a
This command returns the value y which is the display Y-position of the entity name on page and adds a, if provided.
Text, image, draw, touch key and page entities have positions. Other entities, such as variables, do not and will return 0 for their position.
The X-position of an entity can be obtained using "POSX".
Parameters
y- Calculation result.
Parameter type: entity name of a numeric variable (egU8,S32,FLT3etc). page- Page Name.
Parameter type: Immediate entity name. name- Entity Name.
Parameter type: Immediate entity name. a- Input value.
Parameter type: immediate number, or entity name of a numeric variable (egU8,S32,FLT3etc). "POSY"- CALC command operator.
Parameter type: immediate string.
Examples
Example 1
VAR(x, 0, S32); // Result variable VAR(y, 0, S32); // Result variable PAGE(pg1, stPg); { ... POSN(20, 30); DRAW(box, 50, 50, stBox); // Create a box ... } SHOW(pg1); CALC(x, pg1, box, "POSX"); // x = 20 CALC(y, pg1, box, "POSY"); // y = 30 CALC(x, pg1, box, 10, "POSX"); // x = 30 CALC(y, pg1, box, 10, "POSY"); // y = 40

