xHarbour Reference Documentation > Function Reference |
Retrieves the self object during method execution.
HB_QSelf() --> self
The function returns the self object while methods are being executed. Outside the context of methods, the return value is NIL.
Function HB_QSelf() returns the self object in the context of method execution. This is only rquired when methods are implemented with a FUNCTION or PROCEDURE statement rather than a METHOD statement.
Functions or procedures can serve as method implementation when a method of a class is redefined using EXTEND CLASS...WITH METHOD.
Note: when HB_QSelf() is called outside the body of a method implementation, the return value is always NIL. Code blocks cannot retrieve the self object with HB_QSelf(). To access the self object within a code block, self must either be embedded in the code block, or it must be passed as a code block parameter.
See also: | CLASS, EXTEND CLASS...WITH METHOD, HB_QWith() |
Category: | Object functions , xHarbour extensions |
Source: | vm\hvm.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
http://www.xHarbour.com