home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TURCAL.ZIP / TURBOCAL.DOC next >
Encoding:
Text File  |  1988-08-20  |  4.7 KB  |  125 lines

  1. POPCAL.DOC
  2.  
  3. This is the documentation file for the unit TURBOCAL.TPU which is contained
  4. in this archive.  This unit is copyrighted by the author.  Please feel
  5. free to examine and see if it can be of use in your programs.  If you like
  6. the unit and can use it, please send a registration fee of $10.00.
  7.  
  8. This unit REQUIRES the Turbo Professional 4.0 Library from Turbo Power
  9. Software.  It makes use of the units TPCRT and TPSTRING from that library.
  10.  
  11. The unit only has one procedure in the interface section, and that is:
  12.  
  13. procedure calendar(x,y,current_attr,select_attr,other_attr:byte;
  14.                    changeflag:boolean;
  15.                    var year,month,day:word);
  16.  
  17. Paramater Explanation:
  18.  
  19.     x,y:byte
  20.         These are absolute screen coordinates for location of the calendar.
  21.         The unit will automatically adjust these values if the ones passed
  22.         do not allow enough room for the calendar display.
  23.  
  24.     current_attr:byte
  25.         This is the FULL text attribute, i.e. the foreground AND background
  26.         values, used to display the days of the month which is the selected
  27.         month.  If a 0 is passed, the value will default to $0F hex.
  28.  
  29.     select_attr:byte
  30.         This is the FULL text attribute, i.e. the foreground AND background
  31.         values, used to display the day which is the current selected day.
  32.         If a 0 is passed, the value will default to $70 hex.
  33.  
  34.     other_attr:byte
  35.         This is the FULL text attribute, i.e. the foreground and background
  36.         values, used to display the days of the months which precede and
  37.         follow, the current selected month.  If a 0 is passed, the value will
  38.         default to $07 hex.
  39.  
  40.     changeflag:boolean
  41.         This flag determines whether or not you wish to use the unit to
  42.         select a date, or to merely display a calendar.
  43.  
  44.         If the flag is FALSE, then the calendar of the month passed will
  45.         be displayed, and the date passed will be returned in the VAR
  46.         parameters.  The underlying contents of the screen are NOT saved,
  47.         and the programmer will be responsible for removing the calendar
  48.         from the screen.
  49.  
  50.         If the flag is TRUE, then the calendar of the month will be
  51.         displayed, and the user will be allowed to use certain keys to
  52.         select the desired date.  The keys allowed are:
  53.                  UpArrow          Select Previous Month
  54.                  DownArrow        Select Next Month
  55.                  LeftArrow        Select Previous Day
  56.                  RightArrow       Select Next Day
  57.                  PageUp           Select Previous Year
  58.                  PageDown         Select Next Year
  59.                  Return           Accept date which is highlighted
  60.                  Escape           Exit and return 0/0/00 for date
  61.  
  62.         Upon exit, the underlying screen contents ARE restored, and the
  63.         selected date is returned in the VAR parameters.  Along with the
  64.         calendar display, when the changeflag is set to TRUE, a display is
  65.         provided below the calendar which explains the selection keys.
  66.  
  67.     var year,month,day:word
  68.         These parameters contain the original date passed to the unit, and
  69.         if the changeflag was set to TRUE, will contain the selected date
  70.         upon return from the procedure.  If the unit was exited via the
  71.         Escape key, then each parameter will contain a '0'.
  72.  
  73.         This method for the date was selected because there are many
  74.         different methods for constructin Julian dates available, some of
  75.         which are not compatible with others.  Rather than force the
  76.         programmer to use the method used in this unit, the three separate
  77.         parameters were used.
  78.  
  79. A sample call to display the calendar for August 1988, WITHOUT allowing for
  80. date selection would look like this:
  81.  
  82. program foo;
  83. var
  84.   year,month,day:word;
  85.  
  86. begin
  87.   ........
  88.   ........
  89.   year:=1988;
  90.   month:=8;
  91.   day:=17;
  92.   calendar(1,1,$0F,$70,$07,false,year,month,day);
  93.   ........
  94.   ........
  95. end.
  96.  
  97. The call which would allow for date selection, would look like this:
  98.  
  99. program foo;
  100. var
  101.   year,month,day:word;
  102.  
  103. begin
  104.   ........
  105.   ........
  106.   year:=1988;
  107.   month:=8;
  108.   day:=17;
  109.   calendar(1,1,$0F,$70,$07,true,year,month,day);
  110.   ........
  111.   ........
  112. end.
  113.  
  114.  
  115. Again, please feel free to test out the unit to see if it can be of use
  116. to you.  If it is useful I would appreciate a $10.00 registration fee. If
  117. you have any questions, suggestions or bugs, contact me by mail, telephone
  118. or on Compuserve.
  119.  
  120. Kenny D. Walker
  121. 1819 Walthour Road
  122. Savannah, Georgia 31410
  123. (912) 897-3437 (Home)
  124. (912) 233-6691 (Work)
  125. Compuserve User Number: 70235,1160