DO()
Calls a procedure or a function
Syntax
DO( <xFuncProc> [, <xArguments...>] ) --> <xRetVal>
Arguments
<xFuncProc> = Either a string with a function/procedure name to be called or a codeblock to evaluate.
<xArguments> = arguments passed to a called function/procedure or to a codeblock.
Returns
<xRetVal> A value that was returned from called function.
Description
This function can be called either by the harbour compiler or by user. The compiler always passes the item of IT_SYMBOL type that stores the name of procedure specified in DO <proc> WITH … statement.
If called procedure/function doesn’t exist then a runtime error is generated.
This function can be used as replacement of macro operator. It is also used internally to implement DO <proc> WITH <args…> In this case <xFuncProc> is of type HB_SYMB.
Examples
cbCode := {| x | MyFunc( x ) } Do( cbCode, 1 ) cFunction := "MyFunc" xRetVal := Do( cFunction, 2 ) // Old style (slower): DO &cFunction WITH 3
Compliance
Clipper
Files
Library is rtl
Pingback: Harbour All Functions – D | Viva Clipper !
Pingback: Harbour hvm Functions | Viva Clipper !
Pingback: Harbour RG Summary | Viva Clipper !