home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / PJ8_3.ZIP / UCMDS.PAS < prev    next >
Pascal/Delphi Source File  |  1990-02-15  |  707b  |  38 lines

  1. (* ucmds.pas -- (c) 1989 by Tom Swan *)
  2.  
  3. unit ucmds;
  4.  
  5. interface
  6.  
  7. uses crt, ustritem, ulist;
  8.  
  9. type
  10.  
  11.    commandPtr = ^command;
  12.    command = object( strItem )
  13.       cmdCh : char;
  14.       constructor init( theMenu: listPtr; ch : char; description : string );
  15.       function getcmdCh : char; virtual;
  16.    end;
  17.  
  18. implementation
  19.  
  20. { ----- Initialize a new command and insert into theMenu. }
  21.  
  22. constructor command.init( 
  23.    theMenu: listPtr; ch : char; description : string );
  24. begin
  25.    cmdCh := ch;
  26.    strItem.init( description );
  27.    theMenu^.insertItem( @self );
  28. end;
  29.  
  30. { ----- Return a command's character. }
  31.  
  32. function command.getcmdCh : char;
  33. begin
  34.    getcmdCh := cmdCh;
  35. end;
  36.  
  37. end.
  38.