My light version of a Command-line parsing with Delphi attribute ; it's a Primož Gabrijelčič 's idea, found in ITDevCon 2013 Pdf. (no source so I writed it!)
My light version of a Command-line parsing with Delphi attribute ; it's a Primož Gabrijelčič 's idea, found in ITDevCon 2013 Pdf. (no source so I writed it!) interface uses rtti; type ParamNameAttribute = class(TCustomAttribute) protected FName:string; FDefaultValue:TValue; public constructor Create(const AName:string);overload; constructor Create(const AName:string; const ADefaultValue:string);overload; constructor Create(const AName:string; const ADefaultValue:boolean);overload; constructor Create(const AName:string; const ADefaultValue:Integer);overload; property Name:string read FName; property DefaultValue:TValue read FDefaultValue; end; TCmdLine = class(TObject) public constructor Create; end; implementation uses sysutils; { ParamNameAttribute } constructor ParamNameAttribute.Create(const AName: string); begin FName := AName; end; constructor ParamNameAttribute.Create(const AName, ADefaultValue: string); begin ...