home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 3.9 / 1997-12_Disc_3.9_No._1.bin / MEDIA / TECH.DXR / 00051_Text_51.txt
Text File  |  1997-10-08  |  3KB  |  119 lines

  1. --for moviescript
  2. set the keydownscript to "checkKeys" --put this in on the moviescript
  3.  
  4.  
  5. on checkKeys -- example 1
  6.   if the key = RETURN or the key = ENTER then
  7.     searchTitle
  8.     dontpassevent
  9.   else pass
  10. end
  11.  
  12. on searchTitle
  13.   cursor 4
  14.   puppetSound (1) "pioolb"
  15.   global gTB
  16.   mSetCriteria(gTB, "appname", "Contains",  field "searchFld")
  17.   mSelect(gTB)
  18.   set n = mSelectCount(gTB)
  19.   if (n <> 0) then 
  20.     put n into field "NumberFound"
  21.     put mGetField(gTB, "appname") into field "appname"
  22.     put mGetField(gTB, "Contact") into field "contact"
  23.     put mGetField(gTB, "highs") into field "highs"
  24.     put mGetField(gTB, "lows") into field "lows"
  25.     put mGetField(gTB, "BottomLine") into field "BottomLine"
  26.     put mGetField(gTB, "Rating") into field "Rating"
  27.     put mGetField(gTB, "AlphSortKey") into field "AlphSortKey"
  28.   else
  29.     alert "No matching items were found."
  30.   end if
  31.   showselection()
  32.   go to "db2"
  33.   cursor -1
  34. end searchTitle
  35.  
  36.  
  37. -- for search window
  38. on keyDown
  39.   checkKeys 
  40. end
  41.  
  42. --for db2
  43. on keydown
  44.   cursor 4
  45.   global gAlpha
  46.   case (the key) of
  47.     "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z": set i = (the key)
  48.       
  49.       --This will change the char to uppercase if it is lowercase
  50.       if ( i >= "a" and i <= "z") then
  51.         set i = numToChar (charToNum(i) -32)
  52.       end if
  53.       
  54.       put i into field "alphakey"
  55.       UpdateAlphaRT
  56.   end case
  57.   --THIS PART RESETS THE ARROWS
  58.   case (i) of
  59.     "A":set gAlpha to 1
  60.     "B":set gAlpha to 2
  61.     "C":set gAlpha to 3
  62.     "D":set gAlpha to 4
  63.     "E":set gAlpha to 5
  64.     "F":set gAlpha to 6
  65.     "G":set gAlpha to 7
  66.     "H":set gAlpha to 8
  67.     "I":set gAlpha to 9
  68.     "J":set gAlpha to 10
  69.     "K":set gAlpha to 11
  70.     "L":set gAlpha to 12
  71.     "M":set gAlpha to 13
  72.     "N":set gAlpha to 14
  73.     "O":set gAlpha to 15
  74.     "P":set gAlpha to 16
  75.     "Q":set gAlpha to 17
  76.     "R":set gAlpha to 18
  77.     "S":set gAlpha to 19
  78.     "T":set gAlpha to 20
  79.     "U":set gAlpha to 21
  80.     "V":set gAlpha to 22
  81.     "W":set gAlpha to 23
  82.     "X":set gAlpha to 24
  83.     "Y":set gAlpha to 25
  84.     "Z":set gAlpha to 26
  85.   end case
  86.   cursor -1
  87. end
  88.  
  89.  
  90. on UpdateAlphaRT
  91.   puppetSound (1) "pioolb"
  92.   global gTB 
  93.   mSetCriteria(gTB, "AlphSortKey", "start", field "alphaKey")
  94.   mSelect(gTB)
  95.   set n = mSelectCount(gTB)
  96.   if (n <> 0) then 
  97.     put n into field "NumberFound"
  98.     put mGetField(gTB, "appname") into field "appname"
  99.     put mGetField(gTB, "Contact") into field "contact"
  100.     put mGetField(gTB, "highs") into field "highs"
  101.     put mGetField(gTB, "lows") into field "lows"
  102.     put mGetField(gTB, "BottomLine") into field "BottomLine"
  103.     put mGetField(gTB, "Rating") into field "Ratings"
  104.     put mGetField(gTB, "AlphSortKey") into field "AlphSortKey"
  105.     put field "Ratings"&"%" into field "Rating"
  106.   else
  107.     CheckAlphaSearch
  108.   end if
  109.   showselection()
  110. end UpdateAlphaRT
  111.  
  112.  
  113. on CheckAlphaSearch
  114.   global gAlpha
  115.   set gAlpha=gAlpha+1
  116.   if gAlpha>26 then set gAlpha=1
  117.   put char gAlpha of field "alphaBet" into field "alphakey"
  118.   UpdateAlphaRT
  119. end