xHarbour Reference Documentation > Function Reference |
Parses a character string into an array of macro expressions.
HB_AExpressions( <cMacro> ) --> aMacroExpressions
The function returns a one dimensional array holding in its elements individual macro expressions.
Function HB_AExpressions() parses a character string, extracts from it single macro expressions and collects them in the returned array. If the string <cMacro> contains multiple expressions, they must be comma separated.
See also: | & (macro operator), HB_MacroCompile(), HB_VmExecute() |
Category: | Indirect execution , xHarbour extensions |
Source: | vm\arrayshb.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example parses a string holding three macro expressions. The // the individual macro expressions are displayed and then compiled. PROCEDURE Main( ... ) LOCAL cMacro, aExpr PRIVATE nNum := 10 PRIVATE aName := { "xHarbour" } cMacro := "PCount(),(Valtype(nNum)=='N' .AND. nNum>0), aName[1]" aExpr := HB_AExpressions( cMacro ) AEval( aExpr, {|c| QOut(c) } ) ** Output: // PCount() // (Valtype(nNum)=='N' .AND. nNum>0) // aName[1] FOR EACH cMacro IN aExpr ? &cMacro NEXT ** Output: // 0 // .F. // xHarbour RETURN
http://www.xHarbour.com