On Wed, 28 May 2008 16:55:39 -0700 el stamatakos <[EMAIL PROTECTED]> wrote:
> > Hi, > I would like my application to understand command line options. For > example if I type in gedit my app creates some error message if I > enter gedit -test it opens the app. Any ideas? Thanks ErrMsg:=Application.CheckOptions('f:h','file: help'); if ErrMsg<>'' then begin writeln('Wrong options: ',ErrMsg); ShowHelp; exit; end; if Application.HasOption('h','help') then ShowHelp; exit; end; Filename:=Application.GetOptionValue('f','filename'); See http://www.freepascal.org/docs-html/fcl/custapp/tcustomapplication.checkoptions.html Mattias _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus