home *** CD-ROM | disk | FTP | other *** search
/ The Princeton Review - Science Smart / SCIENCE.iso / pc / science / files / cad.dir / 04134.ls < prev    next >
Encoding:
Text File  |  1996-01-26  |  3.4 KB  |  163 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 gscardon to 1
  56.   end if
  57.   set fnum to frametonum(word 2 to the number of words in line gscardon of gmatchlist of line gscardon of gmatchlist)
  58.   go(fnum)
  59.   searchword()
  60. end
  61.  
  62. on prevcard
  63.   global gmatchlistnum, gscardon, gmatchlist
  64.   setoff(0)
  65.   set gscardon to gscardon - 1
  66.   if gscardon = 0 then
  67.     set gscardon to gmatchlistnum
  68.   end if
  69.   set fnum to frametonum(word 2 to the number of words in line gscardon of gmatchlist of line gscardon of gmatchlist)
  70.   go(fnum)
  71.   searchword()
  72. end
  73.  
  74. on setmatch
  75.   global gmatchlistnum, rnum, son, goff
  76.   if goff = 1 then
  77.     if gmatchlistnum > 1 then
  78.       switchmatch(2064)
  79.     else
  80.       switchmatch(2060)
  81.     end if
  82.     exit
  83.   end if
  84.   if gmatchlistnum = 1 then
  85.     if rnum = 1 then
  86.       switchmatch(2060)
  87.     else
  88.       if rnum = son then
  89.         switchmatch(2063)
  90.       else
  91.         if son = 1 then
  92.           switchmatch(2061)
  93.         else
  94.           if (rnum > 1) and (son < rnum) then
  95.             switchmatch(2062)
  96.           end if
  97.         end if
  98.       end if
  99.     end if
  100.   else
  101.     if rnum = 1 then
  102.       switchmatch(2064)
  103.     else
  104.       if rnum = son then
  105.         switchmatch(2067)
  106.       else
  107.         if son = 1 then
  108.           switchmatch(2065)
  109.         else
  110.           if son < rnum then
  111.             if rnum > 1 then
  112.               switchmatch(2066)
  113.             end if
  114.           end if
  115.         end if
  116.       end if
  117.     end if
  118.   end if
  119. end
  120.  
  121. on switchmatch num
  122.   puppetSprite(42, 1)
  123.   set the castNum of sprite 42 to num + 3000
  124.   updateStage()
  125. end
  126.  
  127. on gencor
  128.   set xloc to the mouseH - the locH of sprite 42
  129.   set yloc to the mouseV - the locV of sprite 42
  130.   if yloc < 0 then
  131.     if xloc < -5 then
  132.       return 1
  133.     else
  134.       if xloc > 5 then
  135.         return 2
  136.       else
  137.         return 0
  138.       end if
  139.     end if
  140.   else
  141.     if yloc < 16 then
  142.       if xloc < -5 then
  143.         return 3
  144.       else
  145.         if xloc > 5 then
  146.           return 4
  147.         else
  148.           return 0
  149.         end if
  150.       end if
  151.     end if
  152.   end if
  153.   return 0
  154. end
  155.  
  156. on writemark
  157.   global gWriteobject, marklist, dloc
  158.   set gWriteobject to FileIO(mnew, "write", dloc)
  159.   gWriteobject(mWriteString, string(marklist))
  160.   gWriteobject(mWriteString, "@")
  161.   gWriteobject(mdispose)
  162. end
  163.