xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_AParams()

Collects values of all parameters passed to a function, method or procedure.

Syntax

HB_AParams() --> aValues

Return

The function returns an array holding the values of all parameters passed.

Description

Function HB_AParams() provides a convenient way of collecting all parameters passed to a function, method or procedure with one function call in an array.

Info

See also:PCount(), PValue(), Valtype()
Category: Debug functions , Environment functions , xHarbour extensions
Source:""
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates how an unknown number of command line
// arguments passed to an xHarbour application can be processed.

   PROCEDURE Main( ... )
      LOCAL aArg := HB_AParams()
      LOCAL cArg

      FOR EACH cArg IN aArg
         DO CASE
         CASE Upper( cArg ) IN ("-H/H-?/?")
            ? "Help requested"

         CASE .NOT. cArg[1] IN ( "-/" )
            ?? " argument:", cArg

         CASE Upper( cArg ) IN ("-X/X")
            ? "Execution requested"

         OTHERWISE
            ? "Unknown:", cArg
         ENDCASE
      NEXT

   RETURN

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