home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / tug__002 / demo1.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-08-14  |  3.5 KB  |  110 lines

  1. {TUG PDS CERT 1.01 (Pascal)
  2.  
  3. ==========================================================================
  4.  
  5.                   TUG PUBLIC DOMAIN SOFTWARE CERTIFICATION
  6.  
  7. The Turbo User Group (TUG) is recognized by Borland International as the
  8. official support organization for Turbo languages.  This file has been
  9. compiled and verified by the TUG library staff.  We are reasonably certain
  10. that the information contained in this file is public domain material, but
  11. it is also subject to any restrictions applied by its author.
  12.  
  13. This diskette contains PROGRAMS and/or DATA determined to be in the PUBLIC
  14. DOMAIN, provided as a service of TUG for the use of its members.  The
  15. Turbo User Group will not be liable for any damages, including any lost
  16. profits, lost savings or other incidental or consequential damages arising
  17. out of the use of or inability to use the contents, even if TUG has been
  18. advised of the possibility of such damages, or for any claim by any
  19. other party.
  20.  
  21. To the best of our knowledge, the routines in this file compile and function
  22. properly in accordance with the information described below.
  23.  
  24. If you discover an error in this file, we would appreciate it if you would
  25. report it to us.  To report bugs, or to request information on membership
  26. in TUG, please contact us at:
  27.  
  28.              Turbo User Group
  29.              PO Box 1510
  30.              Poulsbo, Washington USA  98370
  31.  
  32. --------------------------------------------------------------------------
  33.                        F i l e    I n f o r m a t i o n
  34.  
  35. * DESCRIPTION
  36. Demonstration program for TPPICK and TPDIR units.
  37.  
  38. * ASSOCIATED FILES
  39. TPDIR.PAS
  40. DEMO1.PAS
  41. DEMO1.EXE
  42. TPDIR.TPU
  43. TPPICK.PAS
  44. TPPICK.TPU
  45.  
  46. * CHECKED BY
  47. DRM - 08/14/88
  48.  
  49. * KEYWORDS
  50. TURBO PASCAL V4.0 PROGRAM DIRECTORY DEMO MENU
  51.  
  52. ==========================================================================
  53. }
  54. {
  55. Demonstration program for TPPick and TPDir units.
  56.  
  57. This program requires the use of units from the commercial product Turbo
  58. Professional 4.0, by TurboPower Software. It demonstrates two new units,
  59. supplied here. The TPPick unit offers general-purpose scrolling "pick"
  60. windows, which allow the user to scroll though a list of strings and select
  61. one to return to the calling program. The TPDir unit offers a popup directory
  62. unit, useful wherever user entry of filenames is required.
  63.  
  64. Copyright (c) 1987 by TurboPower Software. May be freely used by and
  65. distributed to owners of Turbo Professional 4.0.
  66.  
  67. Turbo Professional 4.0 is a library of 400 general purpose procedures and
  68. functions especially optimized for Turbo Pascal 4.0. It costs $99 and includes
  69. complete source code and a 450 page manual. Contact TurboPower Software at
  70. 408-438-8608 or on Compuserve [72457,2131] for more information.
  71. }
  72.  
  73. {$R-,S-,I-,V-}
  74.  
  75. program Demo;
  76.   {-Demonstrate TPPick and TPDir units}
  77. uses
  78.   Dos,
  79.   TPString,
  80.   TPCrt,
  81.   TPWindow,
  82.   TPPick,
  83.   TPDir;
  84. var
  85.   Mask, Fname : string;
  86. begin
  87.   {Override default position of the pick window}
  88.   if CurrentWidth < 80 then
  89.     TPDir.XLow := 1
  90.   else
  91.     TPDir.XLow := 15;
  92.   TPDir.YHigh := CurrentHeight;
  93.  
  94.   WriteLn('Press Ctrl-Break to quit');
  95.  
  96.   repeat
  97.     Write('Enter a filename mask: ');
  98.     ReadLn(Mask);
  99.     case GetFileName(Mask, Fname) of
  100.       0 : WriteLn('Got filename=', Fname);
  101.       1 : WriteLn('Path not found');
  102.       2 : WriteLn('No matching files');
  103.       3 : WriteLn('Unsupported video mode');
  104.       4 : WriteLn('Insufficient memory');
  105.     else
  106.       WriteLn('Dos critical error');
  107.     end;
  108.   until False;
  109. end.
  110.