Help Center

AfxCommandfunction

Returns command line parameters used to call the program.

WindowsfunctionAfxWin.incdocumented

Syntax

PRIVATE FUNCTION AfxCommand (BYVAL nIndex AS LONG = -1) AS DWSTRING

Parameters

NameDescription
nIndexZero-based index for a particular command-line argument.

Return value

Returns the command-line arguments(s).

Description

Returns command line parameters used to call the program. Unicode replacement for FreeBasic's Command keyword. WCOmmand is an alias or AfxCommand.

Remarks

AfxCommand returns command-line arguments passed to the program upon execution.

If index is less than zero (< 0), a space-separated list of all command-line arguments is returned, otherwise, a single argument is returned. A value of zero (0) returns the name of the executable; and values of one (1) and greater return each command-line argument.

If index is greater than the number of arguments passed to the program, a null string ("") is returned.

Example

FUNCTION AfxCommand (BYVAL nIndex AS LONG = -1) AS DWSTRING #define WCommand AfxCommand

Reference

  • Include file AfxWin.inc
  • Defined in AfxNova/AfxWin.inc:182
  • Documented in Windows/Windows Procedures.md
  • Topic: Windows Procedures