home *** CD-ROM | disk | FTP | other *** search
/ The Princeton Review - Science Smart / SCIENCE.iso / mac / files / CAD.DiR / 04134.ls < prev    next >
Encoding:
Text File  |  1995-12-08  |  3.5 KB  |  170 lines

  1. on searchword
  2.   global rval, son, gsword, rnum
  3.   set rval to EMPTY
  4.   set son to 1
  5.   set rnum to 0
  6.   set tp to numtoframe(the frame)
  7.   set svar to field tp
  8.   repeat with ind = 1 to the number of lines in gsword
  9.     set gstemp to line ind of gsword
  10.     repeat with index = 1 to the number of words in svar
  11.       if word index of svar starts gstemp then
  12.         set rnum to rnum + 1
  13.         put index into line rnum of rval
  14.       end if
  15.     end repeat
  16.   end repeat
  17.   set tst to value(line 1 of rval)
  18.   if (tst <= the number of words in svar) and (rnum <> 0) then
  19.     hilite word value(line 1 of rval) of field tp
  20.     setmatch()
  21.   else
  22.     switchmatch(2064)
  23.   end if
  24. end
  25.  
  26. on nextword
  27.   global son, rval, rnum, gframe
  28.   set son to son + 1
  29.   set tp to gframe + 104
  30.   set svar to field tp
  31.   set checkval to value(line son of rval)
  32.   if checkval <> EMPTY then
  33.     hilite word checkval of field tp
  34.   end if
  35.   setmatch()
  36. end
  37.  
  38. on prevword
  39.   global son, rval, gframe
  40.   set son to son - 1
  41.   set tp to gframe + 104
  42.   set svar to field tp
  43.   set checkval to value(line son of rval)
  44.   if checkval <> EMPTY then
  45.     hilite word checkval of field tp
  46.   end if
  47.   setmatch()
  48. end
  49.  
  50. on nextcard
  51.   global gmatchlistnum, gscardon, gmatchlist
  52.   setoff(0)
  53.   set gscardon to gscardon + 1
  54.   if gscardon > gmatchlistnum then
  55.     set t to 1
  56.     set gscardon to 1
  57.   end if
  58.   set fnum to frametonum(word 2 to the number of words in line gscardon of gmatchlist of line gscardon of gmatchlist)
  59.   go(fnum)
  60.   searchword()
  61. end
  62.  
  63. on prevcard
  64.   global gmatchlistnum, gscardon, gmatchlist
  65.   setoff(0)
  66.   set gscardon to gscardon - 1
  67.   if gscardon = 0 then
  68.     set t to 1
  69.     set gscardon to gmatchlistnum
  70.   end if
  71.   set fnum to frametonum(word 2 to the number of words in line gscardon of gmatchlist of line gscardon of gmatchlist)
  72.   go(fnum)
  73.   searchword()
  74. end
  75.  
  76. on setoff what
  77.   global goff
  78.   set goff to what
  79. end
  80.  
  81. on setmatch
  82.   global gmatchlistnum, rnum, son, goff
  83.   if goff = 1 then
  84.     if gmatchlistnum > 1 then
  85.       switchmatch(2064)
  86.     else
  87.       switchmatch(2060)
  88.     end if
  89.     exit
  90.   end if
  91.   if gmatchlistnum = 1 then
  92.     if rnum = 1 then
  93.       switchmatch(2060)
  94.     else
  95.       if rnum = son then
  96.         switchmatch(2063)
  97.       else
  98.         if son = 1 then
  99.           switchmatch(2061)
  100.         else
  101.           if (rnum > 1) and (son < rnum) then
  102.             switchmatch(2062)
  103.           end if
  104.         end if
  105.       end if
  106.     end if
  107.   else
  108.     if rnum = 1 then
  109.       switchmatch(2064)
  110.     else
  111.       if rnum = son then
  112.         switchmatch(2067)
  113.       else
  114.         if son = 1 then
  115.           switchmatch(2065)
  116.         else
  117.           if son < rnum then
  118.             if rnum > 1 then
  119.               switchmatch(2066)
  120.             end if
  121.           end if
  122.         end if
  123.       end if
  124.     end if
  125.   end if
  126. end
  127.  
  128. on switchmatch num
  129.   puppetSprite(42, 1)
  130.   set the castNum of sprite 42 to num + 3000
  131.   updateStage()
  132. end
  133.  
  134. on gencor
  135.   set xloc to the mouseH - the locH of sprite 42
  136.   set yloc to the mouseV - the locV of sprite 42
  137.   if yloc < 0 then
  138.     if xloc < -5 then
  139.       return 1
  140.     else
  141.       if xloc > 5 then
  142.         return 2
  143.       else
  144.         return 0
  145.       end if
  146.     end if
  147.   else
  148.     if yloc < 16 then
  149.       if xloc < -5 then
  150.         return 3
  151.       else
  152.         if xloc > 5 then
  153.           return 4
  154.         else
  155.           return 0
  156.         end if
  157.       end if
  158.     end if
  159.   end if
  160.   return 0
  161. end
  162.  
  163. on writemark
  164.   global gWriteobject, marklist, dloc
  165.   set gWriteobject to FileIO(mnew, "write", dloc)
  166.   gWriteobject(mWriteString, string(marklist))
  167.   gWriteobject(mWriteString, "@")
  168.   gWriteobject(mdispose)
  169. end
  170.