beautypg.com

Functions – Teledyne LeCroy Conquest User Manual - Users Manual User Manual

Page 239

background image

Appendix A

229

Functions

CURPOS

CURPOS

Remark:

This function returns the current position of the decoder cursor in bits.
CURPOS is initialized to zero at the beginning of the decode and increases by
Length parameter in each instance of AddField statement. CURPOS has a
local scope within the SubFieldOf statements. In each SubFieldOf statement
the CURPOS is a local variable that is initialized to zero, and the incremented
value applies only within the braces of that block.

Example

F1 = AddField(0, 8, "F1", "F1", "F1");

/* CURPOS is equal to 8 and becomes 16 following this statement */

F2 = AddField(CURPOS, 8, "F2", "F2", "F2");

SubFieldOf(F2)

{

F11 = AddField(0, 2, "F11", "F11", "F11");

/* CURPPOS = 2 */

F12 = AddField(CURPOS, 2, "F12", "F12", "F12");

/* CURPPOS = 4 */

F13 = AddField(CURPOS, 4, "F13", "F13", "F13");

/* CURPPOS = 16 */

F3 = AddField(CURPOS, 2, "F3", "F3", "F3");

}

EOD

EOD

Remark:

If CURPOS has reached the end of the data stream, this function returns a
TRUE. Otherwise, a FALSE is returned. You can use this function to detect
unexpected data at the end of the decode.