xHarbour Reference Documentation > Function Reference |
Retrieves the vale of an internal switch set on the command line.
HB_ArgString( <cSwitch> ) --> cValue | NIL
The function returns the value of the commad line switch as a character string. If <cSwitch> is not used at program invocation, the return value is NIL. When it has no value, a null string ("") is returned.
An xHarbour application can be started with regular and internal command line switches, or arguments. Internal switches are prefixed with two slashes, while regular switches are not prefixed. HB_ArgString() retrieves the value of prefixed switches.
See also: | HB_ArgC(), HB_ArgCheck(), HB_ArgV(), PCount(), PValue() |
Category: | Debug functions , Environment functions , xHarbour extensions |
Source: | vm\cmdarg.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example retrieves the value of the command line switch TEST. // The value is displayed, when the program is started as follows // (the command line switch is case insensitive): // // c:\xhb\test.exe //TEST10 // c:\xhb\test.exe //test10 PROCEDURE Main( ... ) ? HB_ArgString( "TEST" ) // result: 10 ? HB_ArgString( "TEST1" ) // result: 0 ? HB_ArgString( "TEST2" ) // result: NIL RETURN
http://www.xHarbour.com