Created
October 21, 2014 21:47
-
-
Save Niceblack/27a65d0a9e1920024367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Запись ключей (-a, -b и т.п.) из аргументов командной строки в set of char | |
Program CommandLineKeys; | |
var | |
keys: set of Char; | |
s: String; | |
i: Integer; | |
begin | |
keys := []; | |
// Разбор командной строки | |
for i := 1 to ParamCount do begin | |
s := ParamStr(i); | |
if (s[1] = '-') then begin | |
Include(keys, s[2]); | |
end; | |
end; | |
// Проверка ключей | |
if 'a' in keys then WriteLn('Key: -a'); | |
if 'b' in keys then WriteLn('Key: -b'); | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment