Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

RDLEVEL()

This function returns the current read level when using READs. It has no use with forms using the Visual FoxPro event model.

Usage

nCurrentReadLevel = RDLEVEL()

Example

IF RDLEVEL()=5  && or 10, in later versions
   WAIT WINDOW "Sorry, you're maxed out. No more READs for you"
ELSE
   DO Another.SPR
ENDIF

In FoxPro 2.x, we mostly used RDLEVEL() in menu SKIP FOR conditions to prevent some options from being available when other options were in use. With a foundation READ in place, giving a menu item a SKIP FOR condition of RDLEVEL()>1 prevents the user from choosing that item when any screen is active. This is useful in modal applications and for items that need to be the only thing running, like reindex routines.

See Also

Read