home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / t_power / dirdemo.pas < prev    next >
Pascal/Delphi Source File  |  1988-01-21  |  2KB  |  56 lines

  1. {
  2. Demonstration program for TPPick and TPDir units.
  3.  
  4. This program requires the use of units from the commercial product Turbo
  5. Professional 4.0, by TurboPower Software. It demonstrates two new units,
  6. supplied here. The TPPick unit offers general-purpose scrolling "pick"
  7. windows, which allow the user to scroll though a list of strings and select
  8. one to return to the calling program. The TPDir unit offers a popup directory
  9. unit, useful wherever user entry of filenames is required.
  10.  
  11. Copyright (c) 1987 by TurboPower Software. May be freely used by and
  12. distributed to owners of Turbo Professional 4.0.
  13.  
  14. Turbo Professional 4.0 is a library of 400 general purpose procedures and
  15. functions especially optimized for Turbo Pascal 4.0. It costs $99 and includes
  16. complete source code and a 450 page manual. Contact TurboPower Software at
  17. 408-438-8608 or on Compuserve [72457,2131] for more information.
  18. }
  19.  
  20. {$R-,S-,I-,V-}
  21.  
  22. program Demo;
  23.   {-Demonstrate TPPick and TPDir units}
  24. uses
  25.   Dos,
  26.   TPString,
  27.   TPCrt,
  28.   TPWindow,
  29.   TPPick,
  30.   TPDir;
  31. var
  32.   Mask, Fname : string;
  33.  
  34. begin
  35.   ClrScr;
  36.   TPPick.PickMatrix := 5;
  37.   TPDir.XLow := 10;
  38.   TPDir.AltPathColor := True;
  39.  
  40.   WriteLn('Press Ctrl-Break to quit');
  41.  
  42.   repeat
  43.     Write('Enter a filename mask: ');
  44.     ReadLn(Mask);
  45.     case GetFileName(Mask, Fname) of
  46.       0 : WriteLn('You chose=''', Fname,'''');
  47.       1 : WriteLn('Path not found');
  48.       2 : WriteLn('No matching files');
  49.       3 : WriteLn('Unsupported video mode');
  50.       4 : WriteLn('Insufficient memory');
  51.     else
  52.       WriteLn('Dos critical error');
  53.     end;
  54.   until False;
  55. end.
  56.