home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 August / Personal_Computer_World_Aug_97.iso / dxrs / cdxpcw08.dxr / 00034_CDXWordSearching.ls < prev    next >
Encoding:
Text File  |  1997-05-22  |  2.8 KB  |  74 lines

  1. on CDXWordSearching
  2.   global CDXWordsearchdata, CDXSomething, CDXWhichTypesList, CDXtypenamesList
  3.   CDXmakeuppercase()
  4.   set querystring to "UPPER(CD_PROD)='" & CDXWordsearchdata & "'"
  5.   DBQuery(querystring)
  6.   set NoGood to 1
  7.   set CDXSomething to 0
  8.   set NoFoundis to 1
  9.   if the result = 0 then
  10.     set resultfound to 1
  11.     repeat while resultfound = 1
  12.       put EMPTY
  13.       CDXAnimate()
  14.       if count(CDXWhichTypesList) > 0 then
  15.         repeat with z = 1 to count(CDXWhichTypesList)
  16.           set SecondList to getAt(CDXWhichTypesList, z)
  17.           if DBGetFieldByName(getAt(SecondList, 1)) <> getAt(SecondList, 2) then
  18.             set NoGood to 0
  19.             exit repeat
  20.           end if
  21.         end repeat
  22.       end if
  23.       if NoGood = 1 then
  24.         set CDXSomething to 1
  25.         put "found:" && NoFoundis into field "CDnoFound"
  26.         set NoFoundis to 1 + NoFoundis
  27.         CDXUpdateList()
  28.       else
  29.         set NoGood to 1
  30.       end if
  31.       DBSkip(1)
  32.       if the result <> 0 then
  33.         set resultfound to 0
  34.       end if
  35.     end repeat
  36.   end if
  37.   if CDXSomething = 0 then
  38.     put EMPTY into field "CDNothingfound"
  39.     put "Nothing found for:" into line 1 of field "CDNothingfound"
  40.     put ".................................................................." into line 2 of field "CDNothingfound"
  41.     put "Name:" && CDXWordsearchdata into line 3 of field "CDNothingfound"
  42.     repeat with t = 1 to count(CDXWhichTypesList)
  43.       set Whichfield to getAt(getAt(CDXWhichTypesList, t), 1)
  44.       repeat with a = 1 to count(CDXtypenamesList)
  45.         if getAt(getAt(CDXtypenamesList, a), 1) = Whichfield then
  46.           set Whichfield to getAt(getAt(CDXtypenamesList, a), 2)
  47.           exit repeat
  48.         end if
  49.       end repeat
  50.       put Whichfield & ":" && getAt(getAt(CDXWhichTypesList, t), 2) into line t + 3 of field "CDNothingfound"
  51.     end repeat
  52.     set the boxType of member "CDNothingfound" to #adjust
  53.     set the textSize of member "CDNothingfound" to 12
  54.     set the margin of member "CDNothingfound" to 2
  55.     set the border of member "CDNothingfound" to 1
  56.     if the machineType > 200 then
  57.       set the textFont of member "CDNothingfound" to "arial"
  58.     else
  59.       set the textFont of member "CDNothingfound" to "Geneva"
  60.     end if
  61.     set the textStyle of line 1 of member "CDNothingfound" to "bold"
  62.     repeat with t = 3 to the lineCount of member "CDNothingfound"
  63.       set the textStyle of word 1 of line t of member "CDNothingfound" to "bold"
  64.       set the textStyle of word 2 of line t of member "CDNothingfound" to "plain"
  65.     end repeat
  66.     updateStage()
  67.     set the castNum of sprite 34 to the number of member "CDNothingfound"
  68.     set the loc of sprite 34 to point(30, 134)
  69.     set the castNum of sprite 35 to the number of member "NothingGraphic"
  70.     set the loc of sprite 35 to point(217, 156)
  71.     updateStage()
  72.   end if
  73. end
  74.