home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 January / WPCJAN97.ISO / refwjan.dxr / 00021_REFA2ZUpdateSection.ls < prev    next >
Encoding:
Text File  |  1996-11-07  |  1.7 KB  |  58 lines

  1. on REFA2ZUpdateSection
  2.   global REFNumDataRecords, ffXobj, openFile, DBCount, REFWordList, REFA2ZSPriteInfo, REFActiveSection, IFLButtonList, IFLReferenceNameSprite, REFSearchActive, REFWords, REFLastActive
  3.   if rollOver(33) and the mouseDown then
  4.     if DBCount < REFNumDataRecords then
  5.       set DBCount to DBCount + 1
  6.     end if
  7.     REFFillWordBox()
  8.     repeat while the mouseDown
  9.     end repeat
  10.   end if
  11.   if rollOver(32) and the mouseDown then
  12.     if DBCount > 1 then
  13.       set DBCount to DBCount - 1
  14.     end if
  15.     REFFillWordBox()
  16.     repeat while the mouseDown
  17.     end repeat
  18.   end if
  19.   if rollOver(34) and the mouseDown then
  20.     set the editableText of sprite 35 to 0
  21.     REFCloseDatabase()
  22.     REFClearSectionSprites()
  23.     REFOriginalStage()
  24.     set REFActiveSection to 0
  25.   end if
  26. end
  27.  
  28. on SearchWord
  29.   global REFSearchWord, ffXobj, REFWords, DBCount
  30.   if the key = RETURN then
  31.     dontPassEvent()
  32.     set REFSearchWord to EMPTY
  33.     repeat with g = 1 to count(REFWords)
  34.       put getAt(getAt(REFWords, g), 1)
  35.       if getAt(getAt(REFWords, g), 1) = field "WordSearch" then
  36.         set DBCount to g
  37.         put DBCount
  38.         REFFillWordBox()
  39.         exit repeat
  40.         next repeat
  41.       end if
  42.       if (g = count(REFWords)) and (getAt(getAt(REFWords, g), 1) <> field "WordSearch") then
  43.         beep()
  44.         dontPassEvent()
  45.         put "'" & field "WordSearch" & "'" & RETURN & "not found" into field "WordNotFound"
  46.         set the locV of sprite 36 to 200
  47.         updateStage()
  48.         startTimer()
  49.         repeat while the timer < (3 * 60)
  50.         end repeat
  51.         set the locV of sprite 36 to 2000
  52.         updateStage()
  53.       end if
  54.     end repeat
  55.     put EMPTY into field "WordSearch"
  56.   end if
  57. end
  58.