home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progpas / tspas18.arj / TSUNTE.INT < prev    next >
Text File  |  1990-02-24  |  4KB  |  112 lines

  1. {$B-,D-,F-,I+,N-,R-,S+,V+}
  2.  
  3. (*
  4. Timo Salmi UNiT E
  5. All rights reserved 19-Aug-89,
  6. Updated 25-Sep-89, 8-Oct-89, 4-Nov-89, 6-Dec-89, 24-Feb-90
  7.  
  8. Cursor routines, keyboard status, configuration information, file information,
  9. calendar routines.
  10. TSUNTE first appears in release TSPAS13 of my Turbo Pascal units package.
  11.  
  12. I have transferred to TSUTNTE the procedures and functions which formerly
  13. were in TSUNTA or TSUNTC, but which do not utilize Turbo Pascal Crt unit.
  14. This makes for better compatibility on less than truly compatible PCs.
  15.  
  16. This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
  17. NON-INSTITUTIONAL purposes, provided it is not changed in any way. For
  18. ANY other usage, contact the author.
  19.  
  20. The units are under development. Comments and contacts are solicited. If
  21. you have any questions, please do not hesitate to use electronic mail for
  22. communication.
  23. InterNet address: ts@chyde.uwasa.fi         (preferred)
  24. Funet address:    GADO::SALMI
  25. Bitnet address:   SALMI@FINFUN
  26. FidoNet address:  2:515/1 (Micro Maniacs Opus, To: Timo Salmi)
  27.  
  28. The author shall not be liable to the user for any direct, indirect or
  29. consequential loss arising from the use of, or inability to use, any unit,
  30. program or file howsoever caused. No warranty is given that the units and
  31. programs will work under all circumstances.
  32.  
  33. Timo Salmi
  34. Professor of Accounting and Business Finance
  35. School of Business Studies, University of Vaasa
  36. P.O. BOX 297, SF-65101 Vaasa, Finland
  37. *)
  38.  
  39. unit TSUNTE;
  40.  
  41. (* ======================================================================= *)
  42.                           interface
  43. (* ======================================================================= *)
  44.  
  45. uses Dos;
  46.  
  47. (* Turns cursor off, and (since the update tspas13) retains the original
  48.    cursor size behind the scenes *)
  49. procedure CURSOFF;
  50.  
  51. (* Restores the cursor as it was before cursoff (unless, of course, you
  52.    have manipulated cursor size yourself in between) *)
  53. procedure CURSON;
  54.  
  55. (* Turns cursor on using user defined cursor size, the ordinary
  56.    color monitor CGA and EGA values are 6 and 7; VGA: 13,14 *)
  57. procedure CURSOR (LowerScanLine, UpperScanLine : byte);
  58.  
  59. (* Turns on a colored border, CGA and VGA, not EGA *)
  60. procedure BORDER (color : byte);
  61.  
  62. (* Clear the keyboard typeahead buffer *)
  63. procedure CLB;
  64.  
  65. (* Is the monitor a monochrome monitor, if false, then color monitor *)
  66. function MONOFN : boolean;
  67.  
  68. (* Is CapsLock on *)
  69. function CAPSONFN : boolean;
  70.  
  71. (* Is NumLock on *)
  72. function NUMLONFN : boolean;
  73.  
  74. (* Does a file exist. Detects also read-only and/or hidden files.
  75.    If the name is a directory, false is returned, since directory
  76.    is not considered a file.
  77.    IMPORTANT: Never apply on an open file! *)
  78. function FEXISTFN (fnimi : string) : boolean;
  79.  
  80. (* The size of any file in bytes. In case of an error, returns -1
  81.    IMPORTANT: Never apply on an open file! *)
  82. function FSIZEFN (filename : string) : longint;
  83.  
  84. (* Space to files is allocated in whole clusters rather than by byte.
  85.    This function gives the cluster size of a device.
  86.    In case of an error, the function returns -1. *)
  87. function CLUSIZFN (device : char) : longint;
  88.  
  89. {$IFNDEF VER40}  (* Not Turbo Pascal 4.0 *)
  90. (* The size of a file in total allocated bytes.
  91.    In case of an error, returns -1
  92.    IMPORTANT: Never apply on an open file! *)
  93. function ALLSIZFN (filename : string) : longint;
  94. {$ENDIF}
  95.  
  96. (* Returns the entire command line, first appearance in tspas14.arc
  97.    IMPORTANT: Must be applied before any file access *)
  98. function CMDLNFN : string;
  99.  
  100. (* Modern weekday based on Zeller's congruence, valid after 14-Sep-1752,
  101.    Sun = 0, Mon = 1 ,..., Sat = 6 *)
  102. function WKDAYFN (day, month, year : word) : byte;
  103.  
  104. (* This function returns the weeknumber of a given date.
  105.    If you consider that it starts on Sunday, set sunday_is_first true.
  106.    If you consider that the week starts on Monday, set sunday_is_first false.
  107.    This function was programmed by Seppo Pynnönen, Ph.D.,
  108.    University of Vaasa, Finland, sjp@chyde.uwasa.fi *)
  109. function WEEKNRFN (day, month, year : word;
  110.                    sunday_is_first : boolean) : integer;
  111.  
  112.