xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_AExpressions()

Parses a character string into an array of macro expressions.

Syntax

HB_AExpressions( <cMacro> ) --> aMacroExpressions

Arguments

<cMacro>
This is a character string holding a list of macro expressions.

Return

The function returns a one dimensional array holding in its elements individual macro expressions.

Description

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.

Info

See also:& (macro operator), HB_MacroCompile(), HB_VmExecute()
Category: Indirect execution , xHarbour extensions
Source:vm\arrayshb.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe