home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 December / WPCDEC97.ISO / DXRS / INXWDEC.DXR / 00035_CDXTYPESearching.ls < prev    next >
Encoding:
Text File  |  1997-10-13  |  3.8 KB  |  101 lines

  1. on CDXTYPESearching
  2.   global CDXWhichTypesList, CDXSomething, CDXWhichIndex
  3.   set firstlist to getAt(CDXWhichTypesList, 1)
  4.   set CDXNumRepeat to 1
  5.   set whichPos to 1
  6.   if CDXWhichIndex = 2 then
  7.     repeat with d = 1 to count(CDXWhichTypesList)
  8.       set whichList to getAt(CDXWhichTypesList, d)
  9.       if getAt(whichList, 1) = "MG_RATE" then
  10.         set WhichRate to getAt(whichList, 2)
  11.         set CDXNumRepeat to integer(5 - WhichRate + 1)
  12.         set whichPos to d
  13.         if whichPos <> 1 then
  14.           deleteAt(CDXWhichTypesList, whichPos)
  15.           addAt(CDXWhichTypesList, 1, whichList)
  16.           set whichPos to 1
  17.           set firstlist to getAt(CDXWhichTypesList, 1)
  18.         end if
  19.         exit repeat
  20.       end if
  21.     end repeat
  22.   end if
  23.   put "CDXWhichTypesList", CDXWhichTypesList
  24.   set CDXSomething to 0
  25.   set NoFoundis to 1
  26.   set NoGood to 1
  27.   put "CDXNumRepeat", CDXNumRepeat
  28.   repeat with s = 1 to CDXNumRepeat
  29.     if (whichPos = 1) and (CDXNumRepeat > 1) then
  30.       set thisnum to integer(getAt(firstlist, 2) + (s - 1))
  31.       put "thisnum", thisnum
  32.       set querystring to "UPPER(" & getAt(firstlist, 1) & ")='" & thisnum & "'"
  33.     else
  34.       set querystring to "UPPER(" & getAt(firstlist, 1) & ")='" & getAt(firstlist, 2) & "'"
  35.     end if
  36.     DBQuery(querystring)
  37.     if the result = 0 then
  38.       set resultfound to 1
  39.       repeat while resultfound = 1
  40.         CDXAnimate()
  41.         if count(CDXWhichTypesList) > 1 then
  42.           repeat with z = 2 to count(CDXWhichTypesList)
  43.             set SecondList to getAt(CDXWhichTypesList, z)
  44.             if DBGetFieldByName(getAt(SecondList, 1)) <> getAt(SecondList, 2) then
  45.               set NoGood to 0
  46.               exit repeat
  47.             end if
  48.           end repeat
  49.         end if
  50.         if NoGood = 1 then
  51.           set CDXSomething to 1
  52.           put "found:" && NoFoundis into field "CDnoFound"
  53.           set NoFoundis to 1 + NoFoundis
  54.           CDXUpdateList()
  55.         else
  56.           set NoGood to 1
  57.         end if
  58.         DBSkip(1)
  59.         if the result <> 0 then
  60.           set resultfound to 0
  61.         end if
  62.       end repeat
  63.     end if
  64.   end repeat
  65.   if CDXSomething = 0 then
  66.     put EMPTY into field "CDNothingfound"
  67.     put "Nothing found for:" into line 1 of field "CDNothingfound"
  68.     put ".................................................................." into line 2 of field "CDNothingfound"
  69.     repeat with t = 1 to count(CDXWhichTypesList)
  70.       set Whichfield to getAt(getAt(CDXWhichTypesList, t), 1)
  71.       repeat with a = 1 to count(WhichINXtypenamesList)
  72.         if getAt(getAt(WhichINXtypenamesList, a), 1) = Whichfield then
  73.           set Whichfield to getAt(getAt(WhichINXtypenamesList, a), 2)
  74.           exit repeat
  75.         end if
  76.       end repeat
  77.       put Whichfield & ":" && getAt(getAt(CDXWhichTypesList, t), 2) into line t + 2 of field "CDNothingfound"
  78.     end repeat
  79.     set the boxType of member "CDNothingfound" to #adjust
  80.     set the textSize of member "CDNothingfound" to 12
  81.     set the margin of member "CDNothingfound" to 2
  82.     set the border of member "CDNothingfound" to 1
  83.     if the machineType > 200 then
  84.       set the textFont of member "CDNothingfound" to "arial"
  85.     else
  86.       set the textFont of member "CDNothingfound" to "Geneva"
  87.     end if
  88.     set the textStyle of line 1 of member "CDNothingfound" to "bold"
  89.     repeat with t = 3 to the lineCount of member "CDNothingfound"
  90.       set the textStyle of word 1 of line t of member "CDNothingfound" to "bold"
  91.       set the textStyle of word 2 of line t of member "CDNothingfound" to "plain"
  92.     end repeat
  93.     updateStage()
  94.     set the castNum of sprite 34 to the number of member "CDNothingfound"
  95.     set the loc of sprite 34 to point(30, 134)
  96.     set the castNum of sprite 35 to the number of member "NothingGraphic"
  97.     set the loc of sprite 35 to point(217, 156)
  98.     updateStage()
  99.   end if
  100. end
  101.