[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|             RDLEVEL             |
+---------------------------------+
RDLEVEL()

-----------------------------------
Returns current READ level.
Return value - Numeric.
----------------------------------

FoxPro supports nested READs.  Nested READs may be created by including
additional GETs and a READ in UDF in a VALID clause.  READs may be
nested to a depth of 5 levels.  The current READ level may be returned
with RDLEVEL(). RDLEVEL() will return a value of 0, 1, 2, 3, 4 or 5
depending how deeply READs are nested.  If RDLEVEL() returns 0, a READ
isn't in effect.

+---------------------------------+
|         Program Example         |
+---------------------------------+
In following example, pressing F2 at any time displays current READ
level.  You can advance to next READ level by pressing Enter or you can
move back READ level by pressing Escape.  Note use of VALID clause and
UDF to create nested READ.  RDLEVEL() is used to return READ level when
F2 is pressed.

CLEAR
ON KEY LABEL F2
@ 2,2 SAY 'Read level: ' + STR(RDLEVEL())
@ 4,2 GET level1 VALID(proc1()) DEFAULT 1
READ                    && READ Level 1
ON KEY LABEL F2

PROCEDURE proc1
@ 6,2 GET level2 VALID(proc2()) DEFAULT 2
READ                    && READ Level 2
RETURN ''

PROCEDURE proc2
@ 8,2 GET level3 VALID(proc3()) DEFAULT 3
READ                    && READ Level 3
RETURN ''

PROCEDURE proc3
@ 10,2 GET level4 DEFAULT 4
READ                    && READ Level 4
RETURN ''

-----------------------------------

See Also:  @ ... SAY/GET, _CUROBJ, OBJNUM(), READ, WREAD()

-----------------------------------

See Also: @ ... SAY/GET OBJNUM() READ WREAD()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson