Knowledge Base

# SetCursor(r|y:Row, c|x:Col) hash function

Valid for use with hash command: HMI Arguments may be specified as Name:Value Pairs

Implemented on the following platforms: HMi430, Android, Windows

Sets the cursor for any subsequent Text to the specified row and column. Row and column are in multiples of the default character size. They both start at 0, so the top lefthand corner of the screen is (0, 0)

In addition to being simple numbers, the row/column coordinates may also be specified in relative or proportional terms. The following table illustrates the possibilities.

Format (example)As a row specifierAs a column specifier
5Row number 5 from the top, counting from 0. This can be a fractional number such as 5.5Column number 5 from the left, counting from 0
-5Row 5 from the bottom, counting from 0. This can be a fractional number such as -5.25Column 5 from the right, counting from 0
0The top character rowThe left-most character column
-0The bottom character rowThe right-most character column
0.25One quarter of (0.25 times) the screen height from the top. Fractional number between -1 and +1 are interpreted as a fraction of the screen.One quarter of the screen width from the left.
-0.25One quarter of the screen height from the bottom.One quarter of the screen width from the right.
CThe top-bottom centre of the screen.The left-right centre of the screen.
C+5Five character rows down from the centreFive character widths right from the centre.
C-5Five character rows up from the centreFive character width left from the centre.
C+.25One quarter character row down from the centre. After a “C” all numbers are interpreted as multiples of the character pitch.One quarter character width right from the centre.
C-3.25Three and a quarter character rows up from the centre. After a “C” all numbers are interpreted as multiples of the character pitch.Three and a quarter character widths left from the centre.

Example:

# HMI Cursor(r:0, c:-3) Print(f(fCounter,4,0))

Display fCounter in the top righthand corner in a field 4 characters wide, with no decimal places . Remember, -0 gives the far right character position, -1 the second character in (space for 2 characters), etc.