xHarbour Reference Documentation > Function Reference |
Determines the nesting level of WITH OBJECT statements.
HB_WithObjectCounter() --> nNestingLevel
The function returns a numeric value indicating the nesting level of WITH OBJECT statements.
Function HB_WithObjectCounter() is used to determine the nesting level of the current WITH OBJECT context. A context can be opened with the WITH OBJECT statement or the HB_SetWith() function.
See also: | HB_SetWith(), HB_QWith(), WITH OBJECT |
Category: | Object functions , xHarbour extensions |
Source: | vm\hvm.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example opens two WITH OBJECT contexts and displays // the result of HB_WithObjectCounter(). PROCEDURE Main() WITH OBJECT ErrorNew() ? :className() // result: ERROR ? HB_WithObjectCounter() // result: 1 WITH OBJECT GetNew() ? :className() // result: GET ? HB_WithObjectCounter() // result: 2 END ? :className() // result: ERROR ? HB_WithObjectCounter() // result: 1 END ? HB_WithObjectCounter() // result: 0 RETURN
http://www.xHarbour.com