Dec 132017
 
Calculates when sunrise and sunset is. Includes TP source code.
File DAYLIGHT.ZIP from The Programmer’s Corner in
Category Science and Education
Calculates when sunrise and sunset is. Includes TP source code.
File Name File Size Zip Size Zip Type
CALCULAT.PAS 4603 1224 deflated
DAYLIGHT.BAS 4227 1763 deflated
DAYLIGHT.DOC 1652 838 deflated
DAYLIGHT.EXE 19472 11028 deflated
DAYLIGHT.PAS 602 292 deflated
GLOBALS.PAS 2048 653 deflated
UI.PAS 5389 1423 deflated

Download File DAYLIGHT.ZIP Here

Contents of the DAYLIGHT.DOC file


About DAYLIGHT 89/07/18
--------------

DAYLIGHT calculates the hours of daylight at a given point on the Earth's
surface when given a Date and Time Zone.

When the program starts up, the position is set to the LATITUDE and LONGITUDE
of Calgary, Alberta, Canada, which is where I live. The DATE is origionally
set to the date stored in your computer's system clock.

This program started life in BASIC on an Apple II. A friend of mine found it
and got it to run on the IBM PC for his scout troop. He gave me a copy and
I rewrote the program in Turbo Pascal and gave it a better user interface.

While rewriting the program, I restructured it so much that I doubt you will
recognize the origional BASIC program as its ancestor. This was done to make
the program readable (not more readable, readable period: no one but an
astronomer would probably understand the program by casually reading it).
I also restuructured the code to make it more portable (I plan to do a
Macintosh version).

- Variables were given meaningful names.
- Constants were identified and their meaning identified (if I could)
- Calculations were separated from user interface code for portability
- Code was modularized (again for portability)

I've included the BASIC program so you can compare it with the Pascal.

If you have any comments or suggestions, please drop me a line.


Mike Babulic Compuserve: 72307,314
3827 Charleswood Dr. N.W. Connect: BABULICMG
Calgary, Alberta
CANADA
T2L 2C7


 December 13, 2017  Add comments

Leave a Reply