home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 502b.lha / PCQ_v1.2 / PCQ_Examples / examples.LZH / Examples / Icons.p < prev    next >
Text File  |  1990-07-17  |  818b  |  31 lines

  1. program Icons;
  2.  
  3. {
  4.   This program shows how to access the arguments passed to a program
  5.   by the Workbench.  Compile and link this program, then make a
  6.   tool icon for it.  Then activate the program by clicking on some
  7.   project icons and this icon.  In my original archive, I included
  8.   a copy of the CLI icon in this directory, so you might be able to
  9.   use it.
  10.  
  11.   This program also shows that PCQ will open a default console window
  12.   if a program run from the Workbench needs it.
  13. }
  14.  
  15. {$I "Include:Utils/Parameters.i"}
  16.  
  17. var
  18.    WB : WBStartupPtr;
  19.    Arg : Integer;
  20. begin
  21.     WB := GetStartupMsg();
  22.     if WB <> nil then begin
  23.     Writeln('There were ', WB^.sm_NumArgs, ' arguments.');
  24.     for Arg := 1 to WB^.sm_NumArgs do
  25.         writeln(WB^.sm_ArgList^[Arg].wa_Name);
  26.     readln;
  27.     end else
  28.     writeln('Run from the CLI');
  29. end.
  30.  
  31.