mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 16:09:16 +02:00
* Some improvements to example
git-svn-id: trunk@35894 -
This commit is contained in:
parent
b6123bb1a8
commit
7f66cdad7c
@ -6,9 +6,9 @@ program testapp;
|
|||||||
uses custapp,classes;
|
uses custapp,classes;
|
||||||
|
|
||||||
Const
|
Const
|
||||||
ShortOpts = 'abc:d:012';
|
ShortOpts = 'iabc:d:012';
|
||||||
Longopts : Array[1..6] of String = (
|
Longopts : Array[1..7] of String = (
|
||||||
'add:','append','delete:','verbose','create:','file:');
|
'insensitive','add:','append','delete:','verbose','create:','file:');
|
||||||
|
|
||||||
Type
|
Type
|
||||||
TTestApp = Class(TCustomApplication)
|
TTestApp = Class(TCustomApplication)
|
||||||
@ -23,6 +23,7 @@ Var
|
|||||||
Opts,FN,Args : TStrings;
|
Opts,FN,Args : TStrings;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
CaseSensitiveOptions:=not HasOption('i','insensitive');
|
||||||
Writeln('Exe name : ',ExeName);
|
Writeln('Exe name : ',ExeName);
|
||||||
Writeln('Help file : ',HelpFile);
|
Writeln('Help file : ',HelpFile);
|
||||||
Writeln('Terminated : ',Terminated);
|
Writeln('Terminated : ',Terminated);
|
||||||
@ -60,6 +61,7 @@ begin
|
|||||||
Writeln('Option append found: ',HasOption('append'));
|
Writeln('Option append found: ',HasOption('append'));
|
||||||
Writeln('Option a or append found: ',HasOption('a','append'));
|
Writeln('Option a or append found: ',HasOption('a','append'));
|
||||||
Writeln('-----------------------');
|
Writeln('-----------------------');
|
||||||
|
Opts.Clear;
|
||||||
GetEnvironmentList(Opts,True);
|
GetEnvironmentList(Opts,True);
|
||||||
Writeln('Found ',Opts.Count,' environment variables');
|
Writeln('Found ',Opts.Count,' environment variables');
|
||||||
For I:=0 to Opts.Count-1 do
|
For I:=0 to Opts.Count-1 do
|
||||||
|
Loading…
Reference in New Issue
Block a user