home *** CD-ROM | disk | FTP | other *** search
- (* The Data Used For This Program Was Derived From TIMEZONE.BAS Written By
- Jeff Jansen Written Microsoft/Otrona BASIC-80 For The Attache Computer.
- I Decided To Take Only The Idea And The Data From His Public Domain
- Program And Translate It Into TURBO Pascal. This Program Requires A
- 80 Column Width By 24 Row Crt. A Minumum Of 76 Columns Is Needed.
- What You Must Do Is Recompile The Program Under TURBO Pascal Program
- TIMEZONE.PAS And Rewrite The set_time Procedure To Read The Clock
- On Your System. If You Do Not Have A Built-In Real Time Computer Clock
- The TIMEZONE.COM File Should Work On Your System. This Version Will
- Only Display The Time For One Specific Time. Whereas If You Rewrite
- The set_time Procedure You Will Have A Program That Will Dispaly The
- Correct Time For One Minute Or Indefinetly If The Line That Reads
- until second = stop; Is Changed To until second = 60;
-
- This Program Is Only For Public Domain Use And Is Not For Sale In
- ANY FORM WHAT SO EVER. Copyright [c] 1986. Version 1.00
- Writen By Ken Isacson On The Heathkit H89A With Turbo Pascal
- Ver. 3.01A
-
- 01/03/1986
-
- Added print_to_screen routine To Replace Triple Program Section
- To Make Program More Versatile With Only One print_to_screen
- Code Section Instead Of Three Sections.
-
- Version 1.10
- 01/03/1986
-
- *)
-
- program timezone_pas;
-
- type
- list = array[1..54] of string[15];
- nums = array[1..54] of integer;
-
- const
- num_of_citys = 54;
- r = 18; (* number of citys div 3 *)
-
- gmtoff : nums = ( 7, -4, 8, 13, 7, 14, 8, -5, 11, 1, 7, 7, 3, 8, 11, 0,
- 7, 8, 11, -1, 6, 16, 7, 7, 1, 8, 14, -1, 8, 8, 8, 7,
- 6, -2, 7, 14, 9, 1, 7, 7, 6, 3, 7, 14, 15, 14, 7, 16,
- 9, 8, 15, 7, 7, 1);
-
- citys : list = ( 'Amsterdam', 'Anchorage', 'Athens', 'Bangkok',
- 'Barcelona', 'Beijing', 'Beirut', 'Berlin', 'Bombay*', 'Boston', 'Brussels',
- 'Budapest', 'Buenos Aires', 'Cairo', 'Calcutta*', 'Chicago', 'Copenhagen',
- 'Damascus', 'Delhi*', 'Denver', 'Dublin', 'Fairbanks', 'Frankfurt', 'Geneva',
- 'Havana', 'Helsinki', 'Hong Kong', 'Honolulu', 'Istanbul', 'Jerusalem',
- 'Johannesburg', 'Lisbon', 'London', 'Los Angeles', 'Madrid', 'Manila',
- 'Moscow', 'New York', 'Oslo', 'Paris', 'Reykjavik', 'Rio de Janeiro', 'Rome',
- 'Saigon', 'Seoul', 'Singapore', 'Stockholm', 'Sydney', 'Tehran*', 'Tel Aviv',
- 'Tokyo', 'Vienna', 'Warsaw', 'Washington, DC');
-
-
- var
- second, minute, hour : integer;
- stop : integer;
- last_time : integer;
- check : boolean;
-
- procedure set_time; (* custom this for your system to get the hour
- minute and seconds from your clock *)
-
- var time : string[6];
- result : integer;
- Len_time : integer;
-
- (* At The End Of This Procedure You Must Have
- The Value Of The Hour In The Integer Variable
- Hour, The Minutes In The Integer Variable
- Minute, The Seconds In The Integer Variable
- Second. This Program Requires Military
- Time. i.e. 3 pm is 15 hundred hours
- *)
-
- begin
-
- repeat
-
- read(time);
- len_time := length(time);
- val(copy(time, len_time-1, 2), second, result);
- until (last_time < second) or (last_time = 59);
-
- val(copy(time, 1, len_time-4), hour, result);
-
- val(copy(time, len_time-3, 2), minute, result);
-
- last_time := second;
-
- end;
-
-
- procedure print_citys;
-
- var
- y : integer;
-
-
- begin
- clrscr;
-
- for y := 1 to r do
- writeln (citys[y]:15,citys[y+r]:26,citys[y+(2*r)]:26);
-
- writeln ('');
- writeln ('');
- Writeln ('':19,'TimeZone Version 1.10 Writen In TURBO Pascal');
- writeln ('':24,'Copywrite [c] 1986, Public Domain');
- writeln ('':30,'Writen By Ken Isacson');
-
- end;
-
- procedure print_to_screen(x : integer; check : boolean; y : integer; sub : integer);
-
- var display : integer;
-
- begin
-
- display := hour + gmtoff[sub];
-
- gotoxy(x,y);
-
- case display of
- 0..23 : write(display:2);
- 24..48 : write(display - 24:2); (* 48 to play its safe *)
- -12..-1 : write(display + 24:2);
- end;
-
- write (':');
-
- if check then
- case minute of
- 0..29 : write(minute + 30:2);
- 30..59 : write(minute - 30:2);
- end
- else write(minute:2);
- write (':',second:2);
-
- end;
-
- procedure print_time;
-
- var
- y : integer;
-
- begin
- for y := 1 to r do
- begin
- case y of
- 9 : check := true;
- 15 : check := true;
- else check := false;
- end;
- print_to_screen (17, check, y, y);
-
- case y of
- 1 : check := true;
- else check := false;
- end;
- print_to_screen (43, check, y, y+r);
-
-
- case y of
- 13 : check := true;
- else check := false;
- end;
- print_to_screen (69, check, y, y + 2*r);
-
- end;
- end;
-
- BEGIN (* main program *)
-
-
- set_time;
- if (second <> 0) then stop := pred(second) else stop := 59;
-
- print_citys;
-
- repeat
- set_time;
- print_time;
- until second = stop; (* This loop will only stop the program after 59 seconds
- To Stop The Program You Need To Punch In
- Control S and the Control C.
- To Have The Program Run Indefinetly Change This
- Line From until second = stop; to read
- second = 60;
- *)
-
- gotoxy (1,24);
- end.
-