Unit 'msesys' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#msegui]

getcommandlinearguments

Returns the arguments passed on the command line, as an array of strings

Declaration

Source position: msesys.pas line 179

function getcommandlinearguments: msestringarty;

Description

Returns the arguments passed on the command line, as an array of strings. Index 0 is the path of the executable, following the same convention as paramstr(0); the actual arguments start at index 1.

uses
  msetypes, { msestringarty }
  msesys, { getcommandlinearguments }
  msestrings, { msestrlicomp }
  sysutils;

const
  coptionname = '--OPTION1=';

var
  larguments: msestringarty;
  i: integer;

begin
  larguments := getcommandlinearguments;
  for i := 1 to high(larguments) do
  begin
    if msestrlicomp(pmsechar(larguments[i]), pmsechar(coptionname), length(coptionname)) = 0 then
    begin
      writeln(copy(larguments[i], length(coptionname) + 1, msetypes.bigint));
    end;
  end;
end.

Documentation generated on: 2026-10-03