Cicode Programming Reference > Cicode Function Categories > Display Functions Introduction > DspGetAnCur

DspGetAnCur

Gets the AN of the current graphics object. This function should only be used by expressions or Cicode functions called from the condition fields of a graphics object, excluding input/command fields. If you need to know the AN that triggered the input/command, the KeyGetCursor function may be used as it returns the AN where the cursor is currently positioned.

You cannot call this function from the Button or Keyboard forms.

Syntax

DspGetAnCur()

Return Value

The AN associated with the current graphics object. If this function is called outside the page animation system or from an input/command field, -1 will be returned.

Example

Numbers

AN

20

Expression

MyFunc(PV_10)

Comment

Display the value of PV_10 at AN20

/* Function displays a number at the current AN and returns the
value supplied in the call */
INT
FUNCTION
MyFunc(INT value)
INT AN, hNew;
AN = DspGetAnCur();
hNew = DspAnNewRel(AN, 0, 20);
DspStr(hNew, "Default", VALUE:###.#);
RETURN value;
END

See Also

Display Functions