home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TJOCKREF.ZIP / MISCTTT.TXT < prev    next >
Encoding:
Text File  |  1988-08-26  |  5.0 KB  |  233 lines

  1. SHORT:Beep               To give a beep on system speaker
  2. Beep                                                           MiscTTT
  3.      
  4.  
  5.  
  6. Purpose   To give 'em a beep.
  7.  
  8. Declaration    Beep;
  9.  
  10. Uses CRT, DOS, MiscTTT.
  11.  
  12. Remarks   This gives a more pleasant tone than ^G.
  13.  
  14. Example
  15.  
  16.  
  17.                USES CRT, DOS, MISCTTT;
  18.                BEGIN
  19.                  IF ........  THEN
  20.                     BEEP;
  21.                END.
  22.      
  23.  
  24.  
  25. !SHORT:Date              Display system date formatted
  26. Date                                                           MiscTTT
  27.           
  28.  
  29.  
  30. Purpose   To display the system date nicely formatted
  31.  
  32. Returns   String;
  33.  
  34. Declaration    Date:string;
  35.  
  36. Uses CRT, DOS, MiscTTT.
  37.  
  38.  
  39.  
  40. Remarks   The format of the returned string is the day followed by the
  41.           month, day of month and year e.g.
  42.                     
  43.                Monday February 1, 1988
  44.  
  45. Example
  46.  
  47.  
  48.                USES CRT, FASTTTT, DOS, MISCTTT;
  49.                BEGIN
  50.                  CLRSCR;
  51.                  WRITECENTER(1,YELLOW,BLACK,DATE);
  52.                END.
  53.           
  54.  
  55. The date would be written at the top center of the screen.
  56.  
  57. !SEEALSO:Time
  58.  
  59.  
  60. !SHORT:Exists            Determine if a file exists
  61. Exists                                                         MiscTTT
  62.      
  63.  
  64.  
  65. Purpose   To determine if a file exists
  66.  
  67. Returns   Boolean;
  68.  
  69. Declaration    Exists(Fl:string):boolean;
  70.                
  71.           Fl is the name of the file, including drive and path if
  72.           necessary.
  73.  
  74. Uses CRT, DOS, MiscTTT.
  75.  
  76. Example
  77.  
  78.  
  79.                USES CRT, DOS, MISCTTT;
  80.                BEGIN
  81.                  IF NOT EXIST('C:\CONFIG.SYS') THEN
  82.                  BEEP;
  83.                END.
  84.      
  85.  
  86.                
  87.  
  88. !SHORT:FlushKeyBuffer    Remove all keystrokes from keyboard buffer
  89. FlushKeyBuffer                                                 MiscTTT
  90.           
  91.  
  92.  
  93. Purpose   To remove all keystrokes from the keyboard buffer.
  94.  
  95. Declaration    FlushkeyBuffer;
  96.  
  97. Remarks   This procedure is most frequently used when you want to stop
  98.           the type-ahead effect.
  99.  
  100. Uses CRT, DOS, MiscTTT.
  101.  
  102. Example
  103.  
  104.  
  105.                USES CRT, FASTTTT, DOS, MISCTTT;
  106.                VAR ANS : CHAR;
  107.                BEGIN
  108.                  WRITEAT(1,WHEREY+1,WHITE,RED,'ARE YOU SURE YOU WANT TO
  109.                  DELETE IT? (Y/N);
  110.                  FLUSHKEYBUFFER;
  111.                  ANS := GETKEY;
  112.                  IF UPCASE(ANS) = 'Y' THEN
  113.                  DELRECORD;
  114.                END.
  115.           
  116.  
  117. The keyboard is flushed in case the user had previously typed a Y in
  118. anticipation of a different question.
  119.  
  120.           
  121.  
  122. !SHORT:Printer_Ready     Indicate if printer is connected and online
  123. Printer_Ready                                                  MiscTTT
  124.      
  125.  
  126.  
  127. Purpose   To indicate if the printer is connected and online.
  128.  
  129. Returns   boolean;
  130.  
  131. Declaration    Printer_Ready: boolean;
  132.  
  133. Uses CRT, DOS, MiscTTT;
  134.  
  135. Remarks   This function is most useful when you want to bullet proof a
  136.           printer option and makes sure that the printer is connected
  137.           and on-line before trying to send it data.
  138.  
  139. Example
  140.  
  141.  
  142.                USES CRT, DOS, MISCTTT;
  143.                BEGIN
  144.                  IF PRINTER_READY THEN PRINTSCREEN;
  145.                END.
  146.      
  147.  
  148.                
  149.  
  150. !SHORT:Print_Screen      Emulate print screen key
  151. Print_Screen                                                   MiscTTT
  152.           
  153.  
  154.  
  155. Purpose   To emulate the Print Scrn key.
  156.  
  157. Declaration    PrintScreen
  158.  
  159. Uses CRT, DOS, MiscTTT.
  160.  
  161. Example
  162.  
  163.  
  164.                USES CRT, DOS, MISCTTT
  165.                BEGIN
  166.                  PRINTSCREEN;
  167.                END.
  168.           
  169.  
  170.           
  171.                
  172.  
  173. !SHORT:Reset_Printer     Clear a printer's setting back to default
  174. Reset_Printer                                                  MiscTTT
  175.      
  176.  
  177.  
  178. Purpose   To clear a printer's settings back to the default.
  179.  
  180. Declaration    Reset_Printer;
  181.  
  182. Uses CRT, DOS, MiscTTT.
  183.  
  184.  
  185.  
  186. Remarks   This procedure uses a unique technique that will reset most
  187.           of the PC printers on the market place today. It is
  188.           recommended that this procedure be called prior to sending
  189.           set-up strings to a printer.
  190.  
  191. Example
  192.  
  193.  
  194.                USES CRT, DOS, MISCTTT
  195.                BEGIN
  196.                  RESET_PRINTER;
  197.                END.
  198.      
  199. !SEEALSO:Printer_Ready
  200.  
  201.  
  202. !SHORT:Time              Display system time formatted
  203. Time                                                           MiscTTT
  204.           
  205.  
  206.  
  207. Purpose   To display the system time nicely formatted
  208.  
  209. Returns   String;
  210.  
  211. Declaration    Time:string;
  212.  
  213. Uses CRT, DOS, MiscTTT;
  214.  
  215.  
  216.  
  217. Remarks   The format of the returned string is hour:min:sec a.m. or
  218.           hour:min:sec p.m.
  219.  
  220. Example
  221.  
  222.  
  223.                USES CRT, FASTTTT, DOS, MISCTTT;
  224.                BEGIN
  225.                  CLRSCR;
  226.                  WRITECENTER(1,YELLOW,BLACK,TIME);
  227.                END.
  228.           
  229.  
  230. The time would be written at the top center of the screen.
  231.  
  232. !SEEALSO:Date
  233.