home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / fun / astroalm.sit / Almanac / card_7837.txt < prev    next >
Text File  |  1989-10-15  |  8KB  |  358 lines

  1. -- card: 7837 from stack: in
  2. -- bmap block id: 8910
  3. -- flags: 0000
  4. -- background id: 2765
  5. -- name: Occult.
  6. ----- HyperTalk script -----
  7. on fetchOcc he
  8.   global doo,oldit,she,today,moon
  9.   if moon=0 then exit fetchOcc
  10.   put empty into oldit
  11.   put 2 into las
  12.   put false into done
  13.   if he is empty then exit fetchOcc
  14.   put word 1 of he && word 2 of he into she
  15.   get char 2 of word 2 of last line of cd fld total
  16.   if it is "/" then subtract 1 from las
  17.   put word 1 of last line of cd fld total && char 1 to las of word 2 of last line of cd fld total into today
  18.   if not((today is in she) and (she is in today)) or doo=1 then
  19.     -- import text
  20.     if number of chars of he=5 then put space after char 3 of he
  21.     -- put proper path name here...
  22.     -- If you have a custom file, set it up like the example provided.
  23.     -- otherwise ...  delete this card.  Also, I am working on a Moon
  24.     -- RA and Dec. script.
  25.     put "Hard Disk:Astronomy:Oc-" & last word of the long date into fileName
  26.     if the shiftKey is up and number of lines of cd fld total Γëá 0 then
  27.       select text of cd fld total
  28.       doMenu "Clear Text"
  29.     end if
  30.     open file fileName
  31.     put the ticks into t0
  32.     repeat
  33.       set cursor to busy
  34.       read from file fileName until "&"
  35.       if it is empty then
  36.         exit repeat
  37.       end if
  38.       delete last char of it
  39.       if it contains he then
  40.         exit repeat
  41.       else
  42.         --    put he && char 6 to 7 of line 3 of it
  43.         if first word of he is in it and second word of he< char 6 to 7 of line 3 of it then
  44.           put true into done
  45.           exit repeat
  46.         end if
  47.       end if
  48.       put it into oldit
  49.     end repeat
  50.     if done then
  51.       close file fileName
  52.       put "           No totals for this date." into line 6 of cd fld total
  53.       exit fetchOcc
  54.     end if
  55.     close file fileName
  56.     put the ticks into t1
  57.     put number of lines of oldit into nlines
  58.     put 0 into prevday
  59.     if getday(it)-getday(oldit)=1 then
  60.       repeat with i=3 to nlines
  61.         if char 9 to 10 of line i of oldit >=20 then
  62.           put i into oldi
  63.           repeat with i=oldi to nlines
  64.             put "*" into char 1 of line i of oldit
  65.           end repeat
  66.           put return & line oldi to nlines of oldit after line 2 of it
  67.           exit repeat
  68.         end if
  69.       end repeat
  70.     end if
  71.     if hilite of button 3 then
  72.       put the number of lines of it into num
  73.       if num=0 then exit fetchOcc
  74.       put line 1 to 2 of it & return into cd fld total
  75.       repeat with i=3 to num
  76.         if (char 16 of line i of it)>=char 1 of cd fld Filter then
  77.           put line i of it & return after cd fld total
  78.         end if
  79.       end repeat
  80.       put 1 into j
  81.     else
  82.       put it after cd fld total
  83.       put -1 into j
  84.     end if
  85.     get the number of lines of cd fld total
  86.     if it > 0 then put "   (" & it-3+j && "totals)" after line 1 of cd fld total
  87.     put " "& rnd10((t1-t0)/60) &" s." after line 1 of cd fld total
  88.     find "STAR"
  89.     repeat until ": " is not in cd fld total
  90.       find string ": " in fld total
  91.       put "put ""e&":0""e&&"into" && the foundChunk into command
  92.       do command
  93.     end repeat
  94.   end if
  95. end fetchOcc
  96.  
  97. function getday arg
  98. get char 6 to 7 of line 3 of arg
  99. return it
  100. end getday
  101.  
  102. on openCard
  103.   show btn Print
  104.   set textFont of cd fld total to Courier
  105.   pass openCard
  106. end openCard
  107.  
  108. on closeCard
  109.   hide btn Print
  110.   pass closeCard
  111. end closeCard
  112.  
  113.  
  114.  
  115. -- part 1 (field)
  116. -- low flags: 00
  117. -- high flags: 0007
  118. -- rect: left=37 top=98 right=262 bottom=389
  119. -- title width / last selected line: 0
  120. -- icon id / first selected line: 0 / 0
  121. -- text alignment: 0
  122. -- font id: 15036
  123. -- text size: 12
  124. -- style flags: 0
  125. -- line height: 16
  126. -- part name: total
  127.  
  128.  
  129. -- part 3 (button)
  130. -- low flags: 00
  131. -- high flags: 8003
  132. -- rect: left=290 top=313 right=334 bottom=371
  133. -- title width / last selected line: 0
  134. -- icon id / first selected line: 0 / 0
  135. -- text alignment: 1
  136. -- font id: 0
  137. -- text size: 12
  138. -- style flags: 0
  139. -- line height: 16
  140. -- part name: Other Days
  141. ----- HyperTalk script -----
  142. on mouseUp
  143.   Ask "Enter date (mon dd):"
  144.   put it into he
  145.   fetchOcc he
  146. end mouseUp
  147.  
  148.  
  149.  
  150. -- part 6 (button)
  151. -- low flags: 00
  152. -- high flags: 8003
  153. -- rect: left=6 top=313 right=334 bottom=87
  154. -- title width / last selected line: 0
  155. -- icon id / first selected line: 0 / 0
  156. -- text alignment: 1
  157. -- font id: 0
  158. -- text size: 12
  159. -- style flags: 0
  160. -- line height: 16
  161. -- part name: Today
  162. ----- HyperTalk script -----
  163. on mouseUp
  164.   global doo,dodoo
  165.   put char 1 to 3 of second word of nDate(1,12,0) && first word of nDate(1,12,0) into he
  166.   if dodoo=1 then put 1 into doo
  167.   fetchOcc he
  168.   put 0 into doo
  169. end mouseUp
  170.  
  171.  
  172.  
  173. -- part 7 (button)
  174. -- low flags: 00
  175. -- high flags: C006
  176. -- rect: left=230 top=76 right=95 bottom=307
  177. -- title width / last selected line: 0
  178. -- icon id / first selected line: 0 / 0
  179. -- text alignment: 1
  180. -- font id: 0
  181. -- text size: 12
  182. -- style flags: 0
  183. -- line height: 16
  184. -- part name: Filter  >=
  185. ----- HyperTalk script -----
  186. on mouseUp
  187.   global doo,dodoo
  188.   set hilite of me to not hilite of me
  189.   put 1 into dodoo
  190.   send mouseUp to btn today
  191.   put 0 into dodoo
  192. end mouseUp
  193.  
  194.  
  195.  
  196. -- part 8 (button)
  197. -- low flags: 80
  198. -- high flags: 2004
  199. -- rect: left=182 top=304 right=342 bottom=227
  200. -- title width / last selected line: 0
  201. -- icon id / first selected line: 15844 / 15844
  202. -- text alignment: 1
  203. -- font id: 0
  204. -- text size: 12
  205. -- style flags: 0
  206. -- line height: 16
  207. -- part name: Print
  208. ----- HyperTalk script -----
  209. on mouseUp
  210.   printField cd fld 1,"Courier"
  211. end mouseUp
  212.  
  213.  
  214.  
  215. -- part 9 (button)
  216. -- low flags: 00
  217. -- high flags: A003
  218. -- rect: left=90 top=313 right=334 bottom=171
  219. -- title width / last selected line: 0
  220. -- icon id / first selected line: 0 / 0
  221. -- text alignment: 1
  222. -- font id: 0
  223. -- text size: 12
  224. -- style flags: 0
  225. -- line height: 16
  226. -- part name: Tomorrow
  227. ----- HyperTalk script -----
  228. on mouseUp
  229.   global doo
  230.   put 1 into doo
  231.   put char 1 to 3 of second word of nDate(1,12,1) && first word of nDate(1,12,1) into he
  232.   fetchOcc he
  233.   put 0 into doo
  234. end mouseUp
  235.  
  236.  
  237.  
  238.  
  239. -- part 10 (field)
  240. -- low flags: 00
  241. -- high flags: 0000
  242. -- rect: left=298 top=76 right=93 bottom=326
  243. -- title width / last selected line: 0
  244. -- icon id / first selected line: 0 / 0
  245. -- text alignment: 1
  246. -- font id: 0
  247. -- text size: 12
  248. -- style flags: 0
  249. -- line height: 16
  250. -- part name: Filter
  251.  
  252.  
  253. -- part 11 (field)
  254. -- low flags: 80
  255. -- high flags: 0001
  256. -- rect: left=43 top=224 right=255 bottom=278
  257. -- title width / last selected line: 0
  258. -- icon id / first selected line: 0 / 0
  259. -- text alignment: 0
  260. -- font id: 3
  261. -- text size: 12
  262. -- style flags: 0
  263. -- line height: 16
  264. -- part name: mr
  265.  
  266.  
  267. -- part 12 (field)
  268. -- low flags: 80
  269. -- high flags: 0001
  270. -- rect: left=43 top=259 right=295 bottom=278
  271. -- title width / last selected line: 0
  272. -- icon id / first selected line: 0 / 0
  273. -- text alignment: 0
  274. -- font id: 3
  275. -- text size: 12
  276. -- style flags: 0
  277. -- line height: 16
  278. -- part name: ms
  279.  
  280.  
  281. -- part 13 (field)
  282. -- low flags: 80
  283. -- high flags: 0004
  284. -- rect: left=13 top=40 right=205 bottom=360
  285. -- title width / last selected line: 0
  286. -- icon id / first selected line: 0 / 0
  287. -- text alignment: 0
  288. -- font id: 3
  289. -- text size: 12
  290. -- style flags: 0
  291. -- line height: 16
  292. -- part name: data
  293.  
  294.  
  295. -- part contents for background part 7
  296. ----- text -----
  297. Sidereal Time = 21:18
  298. 21.3103726
  299.  
  300. -- part contents for background part 6
  301. ----- text -----
  302. Universal Time = 1:15
  303. 1.2633333
  304. 200
  305.  
  306. -- part contents for background part 31
  307. ----- text -----
  308. Julian Date = 2447815.553
  309.  
  310. -- part contents for background part 14
  311. ----- text -----
  312. Occult.
  313.  
  314. -- part contents for background part 10
  315. ----- text -----
  316. Occult. R.A. = 17h 59m
  317. Occult. Dec.  = 0┬░ 00'
  318. below W horizon
  319.  
  320. 269.813
  321. 0
  322.  
  323. -- part contents for background part 13
  324. ----- text -----
  325. Occult. Rises at 5:28 AM
  326. Occult. Sets  at 5:28 PM
  327. 47.471
  328. 5.471
  329. 17.471
  330.  
  331. -- part contents for background part 28
  332. ----- text -----
  333. 16 October 1989 (JT)
  334.  
  335. -- part contents for background part 39
  336. ----- text -----
  337.  98%-
  338.  
  339. -- part contents for card part 10
  340. ----- text -----
  341. 3
  342.  
  343. -- part contents for card part 13
  344. ----- text -----
  345. -3785 -.680872521 0.208333333
  346. -5.80579963
  347. 0.283656922
  348. 57.451297137
  349. -3784.791666667
  350.  
  351. -- part contents for card part 1
  352. ----- text -----
  353. RATING FOR OCT 16 =  .26   (3 totals) 1.5 s.
  354.  DATE   T(UT) PR STAR #  MAG  PCT MN  SN  CA
  355.  OCT 16/ 1:20 R3   0357  8.0  98- 22      82N
  356.  OCT 16/ 5:33 R3 X03455  7.9  97- 71      90S
  357.  OCT 16/ 7:36 R4   0387  6.9  97- 71      56N
  358.