| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Collects values of all parameters passed to a function, method or procedure.
HB_AParams() --> aValues
The function returns an array holding the values of all parameters passed.
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.
| See also: | PCount(), PValue(), Valtype() |
| Category: | Debug functions , Environment functions , xHarbour extensions |
| Source: | "" |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// 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
http://www.xHarbour.com