FUNCTIONS CORE

CmdArgArgV()

Return the program name as it was started

Syntax

Signature
CmdArgArgV( ) --> cProgram

Arguments

None.

Return value

The first word of the command line: the program as the user or the system started it.

Description

CmdArgArgV() is the same as ArgV( 0 ). The text may be a name without a directory, for example "report", or a full path. ExeName() always gives the full path of the program file.

Example

CmdArgArgV.prg
PROCEDURE Main()

   Check( 'CmdArgArgV() is ArgV( 0 )        ', CmdArgArgV(), ArgV( 0 ) )
   Check( 'CmdArgArgV() is not empty        ', Empty( CmdArgArgV() ), .F. )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

   QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )

RETURN

Output

CmdArgArgV() is ArgV( 0 )        OK
CmdArgArgV() is not empty        OK

See also