home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1B / DATAFILE_PDCD1B.iso / _pocketbk / pocketbook / 001 / worldc_zip / WORLDCLK.OPLd < prev   
Text File  |  1993-01-30  |  5KB  |  170 lines

  1.  
  2. rem (c) 1993 Les Hall
  3. rem CIS Address 71053,1676
  4.  
  5. rem remove or rem out the next four lines if you do
  6. rem not want this to be made into a an OPA type file
  7.  
  8. APP Worldclk    rem set up for icon
  9. TYPE 1    rem set file type
  10. ICON "M:\PIC\CLOCK.pic"    rem put the clock.pic(icon) in a directory called PIC on M:
  11. ENDA
  12.  
  13.  
  14. PROC Worldclk:
  15. local g%                rem get keystrokes
  16. local off1&,off2&,off3&        rem time offsets
  17. local pl1$(11),pl2$(11),pl3$(11)    rem place name var's
  18. local win%(4)            rem we will have 4 windows
  19. if not exist ("M:\OPD\WORLDCLK.DAT")    rem check for file or create one change M: to A:,B: everywhere is is found
  20.     create "M:\OPD\WORLDCLK.DAT",A,place1$,place2$,place3$,diff1&,diff2&,diff3&
  21.     A.place1$="LOS ANGELES"        rem install initial names
  22.     A.place2$="DALLAS"
  23.     A.place3$="CONCORD, MA"
  24.     A.diff1&=-120            rem install initial time differences
  25.     A.diff2&=0
  26.     A.diff3&=54    rem for a joke we put Psion six minutes behind everywhere else....
  27.     append                rem write a record to file WORLDCLK.DAT
  28.     beep 3,500
  29.     dinit                rem set up first time dialogue
  30.     dtext "","Welcome to World Clock!",$302
  31.     dtext "","Press [Enter] at main screen to",2
  32.     dtext "","set up cities & time differences.",2
  33.     dtext "","Enter time differences in minutes.",2
  34.     dtext "","A city two hours behind = -120",2
  35.     dtext "","A city four hours ahead = 240",2
  36.     dtext "","Press [Enter] now.",2
  37.     dialog    rem this dialog only seen on first running or when file Worldclk.Dat does not exist
  38. else
  39.     open   "M:\OPD\WORLDCLK.DAT",A,place1$,place2$,place3$,diff1&,diff2&,diff3&
  40. endif
  41.  
  42. win%(1)=gcreate(0,20,80,60,1)        rem open four windows when needed
  43. win%(2)=gcreate(80,20,80,60,1)
  44. win%(3)=gcreate(160,20,80,60,1)
  45. win%(4)=gcreate(0,0,240,14,1)
  46.  
  47. last                rem go to our record in file WORLDCLK.DAT & get settings
  48.  
  49. do                rem enter loop
  50.     guse win%(4)
  51.     gat 0,0
  52.     gfill 240,14,2            rem our clock titles
  53.     gtmode 0                rem are being set up here
  54.     gstyle 5
  55.     gat 0,10
  56.     gprintb A.place1$,80,3,20,20        rem print city 1 name
  57.     gat 80,10
  58.     gprintb A.place2$,80,3,20,20        rem print city 2
  59.     gat 160,10
  60.     gprintb A.place3$,80,3,20,20        rem print city 3
  61.  
  62.     guse win%(1)
  63.     gat 7,0 Rem position the clocks.
  64.     gclock on,$25,A.diff1&        rem our first clock with time difference
  65.     guse win%(2)
  66.     gat 7,0
  67.     gclock on,$25,A.diff2&        rem our second clock
  68.     guse win%(3)
  69.     gat 7,0
  70.     gclock on,$25,A.diff3&        rem our third clock
  71. g%=get
  72.  
  73.     guse win%(1)            rem turn off clocks when we do dialog
  74.     gclock off
  75.     guse win%(2)
  76.     gclock off
  77.     guse win%(3)
  78.     gclock off
  79.  
  80. if g%=291    rem Help key
  81.     help:
  82. endif
  83.  
  84. if g%=13                rem Enter key?
  85.     dinit"Enter Cities & Time Differences In Minutes"
  86.     pl1$=A.place1$            rem our dialog accepts names & time
  87.     dedit pl1$,"City 1: (Max 11 Letters)"    rem differences and saves to file with
  88.     off1&=A.diff1&             rem an update command
  89.     dlong off1&,"Time Difference 1:",-1440,1440
  90.     pl2$=A.place2$
  91.     dedit pl2$,"City 2: (Max 11 Letters)"
  92.     off2&=A.diff2&
  93.     dlong off2&,"Time Difference 2:",-1440,1440
  94.     pl3$=A.place3$
  95.     dedit pl3$,"City 3: (Max 11 Letters)"
  96.     off3&=A.diff3&
  97.     dlong off3&,"Time Difference 3:",-1440,1440
  98.     dialog                rem show the dialog
  99.  
  100.     A.place1$=upper$(pl1$)        rem assign var's to file
  101.     A.place2$=upper$(pl2$)
  102.     A.place3$=upper$(pl3$)
  103.     A.diff1&=off1&
  104.     A.diff2&=off2&
  105.     A.diff3&=off3&
  106.     update                rem update the file
  107. endif
  108. until g%=27              rem keep going till [Esc] key
  109.     busy "No time to lose!",3 rem quiting program dialog
  110.     pause -20 rem let user read the above, or continue by hitting any key
  111. Endp
  112.  
  113. proc help:
  114. local g%
  115. top::
  116. dinit
  117. dtext "","Help: Worldclock",$300
  118. dtext "","úUsing Worldclock",$500
  119. dtext "","úSetting Worldclock",$500
  120. dtext "","úAbout Wordclock",$500
  121. dtext "","úKudos, Thanks",$500
  122. g%=dialog
  123. if g%=0        rem any key other than enter on a line
  124. return        rem get outta here
  125. elseif g%=291    rem help key?
  126. return        rem get outta here
  127. elseif g%=2    rem second line selected?
  128. dinit
  129. dtext "","Help: Using Worldclock",$300
  130. dtext "","Worldclock allows you to set up three",0
  131. dtext "","clocks showing the time & name of cities",0
  132. dtext "","in different time zones. You could use",0
  133. dtext "","city names or zone names like 'Hope,AR'",0
  134. dtext "","or 'Pacific' etc. your settings are saved",0
  135. dtext "","to a small file called Worldclk.DAT on M:.",0
  136. dialog
  137. goto top::
  138. elseif g%=3
  139. dinit
  140. dtext "","Help: Setting Worldclock",$300
  141. dtext "","Press [Enter], you are shown the time",0
  142. dtext "","difference & city naming dialog. Enter",0
  143. dtext "","the titles for each clock and its time",0
  144. dtext "","difference from your home. A city 2 hours",0
  145. dtext "","behind would be entered as -120. A city",0
  146. dtext "","3 hours ahead would be entered as 180.",0
  147. dialog
  148. goto top::
  149. elseif g%=4
  150. dinit
  151. dtext "","Wordclock vers 1.01",$102
  152. dtext "","¸1993 Les Hall",$102
  153. dtext "","CIS 71053,1676",$102
  154. dtext "",chr$(34)+"levitas tempus"+chr$(34),2
  155. dialog
  156. goto top::
  157. elseif g%=5
  158. dinit
  159. dtext "","Help: Kudos, Thanks",$300
  160. dtext "","Again, thanks to Pison PLC & Psion Inc",0
  161. dtext "","for making great palmtop computers.",0
  162. dtext "","Special thanks to Mark Esposito for all",0
  163. dtext "","the pointers & code sharing. And very",0
  164. dtext "","grateful thanks to Jim Hoyt for just",0
  165. dtext "","being a real gent. Love all. Les Hall.",0
  166. dialog
  167. goto top::
  168. endif
  169. endp rem It's all over....
  170.