xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_ArgCheck()

Checks if an internal switch is set on the command line.

Syntax

HB_ArgCheck( <cSwitch> ) --> lExists

Arguments

<cSwitch>
This is a character string holding the symbolic name of the internal command line switch to check.

Return

The function returns .T. (true) when the xHarbour application is started with <cSwitch> set on the command line, otherwise .F. (false) is returned.

Description

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_ArgCheck() tests only the existence of prefixed switches.

Note:  use function HB_ArgString() to retrieve the value of an internal command line switch.

Info

See also:HB_ArgC(), HB_ArgV(), HB_ArgString(), PCount(), PValue()
Category: Debug functions , Environment functions , xHarbour extensions
Source:vm\cmdarg.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example tests for the existence of the command line switch TEST.
// The result is only true, when the program is started as follows
// (the command line switch is case insensitive):
//
//   c:\xhb\test.exe  //TEST
//   c:\xhb\test.exe  //test

   PROCEDURE Main( ... )

      ? HB_ArgCheck( "TEST" )

   RETURN

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