home *** CD-ROM | disk | FTP | other *** search
- on CDXWordSearching
- global CDXWordsearchdata, CDXSomething, CDXWhichTypesList, WhichINXtypenamesList, CDXWhichIndex
- CDXmakeuppercase()
- set CDXNumRepeat to 1
- set whichPos to 1
- case CDXWhichIndex of
- 1:
- set querystring to "UPPER(CD_PROD)='" & CDXWordsearchdata & "'"
- 2:
- set querystring to "UPPER(MG_PROD)='" & CDXWordsearchdata & "'"
- end case
- DBQuery(querystring)
- set NoGood to 1
- set CDXSomething to 0
- set NoFoundis to 1
- if the result = 0 then
- set resultfound to 1
- repeat while resultfound = 1
- CDXAnimate()
- if (CDXWhichIndex = 2) and (count(CDXWhichTypesList) > 0) then
- repeat with d = 1 to count(CDXWhichTypesList)
- set whichList to getAt(CDXWhichTypesList, d)
- if getAt(whichList, 1) = "MG_RATE" then
- set WhichRate to getAt(whichList, 2)
- set CDXNumRepeat to integer(5 - WhichRate + 1)
- set whichPos to d
- if whichPos <> 1 then
- deleteAt(CDXWhichTypesList, whichPos)
- addAt(CDXWhichTypesList, 1, whichList)
- end if
- exit repeat
- end if
- end repeat
- end if
- if CDXNumRepeat > 1 then
- set CDXWhichTypesListTemp to value(string(CDXWhichTypesList))
- set starthere to getAt(getAt(CDXWhichTypesListTemp, 1), 2)
- repeat with a = 1 to CDXNumRepeat
- setAt(getAt(CDXWhichTypesListTemp, 1), 2, integer(starthere + (a - 1)))
- repeat with z = 1 to count(CDXWhichTypesListTemp)
- set SecondList to getAt(CDXWhichTypesListTemp, z)
- if DBGetFieldByName(getAt(SecondList, 1)) <> getAt(SecondList, 2) then
- set NoGood to 0
- exit repeat
- end if
- end repeat
- if NoGood = 1 then
- set CDXSomething to 1
- put "found:" && NoFoundis into field "CDnoFound"
- set NoFoundis to 1 + NoFoundis
- CDXUpdateList()
- next repeat
- end if
- set NoGood to 1
- end repeat
- else
- if count(CDXWhichTypesList) > 0 then
- repeat with z = 1 to count(CDXWhichTypesList)
- set SecondList to getAt(CDXWhichTypesList, z)
- if DBGetFieldByName(getAt(SecondList, 1)) <> getAt(SecondList, 2) then
- set NoGood to 0
- exit repeat
- end if
- end repeat
- end if
- end if
- if (NoGood = 1) and (CDXNumRepeat = 1) then
- put "here"
- set CDXSomething to 1
- put "found:" && NoFoundis into field "CDnoFound"
- set NoFoundis to 1 + NoFoundis
- CDXUpdateList()
- else
- set NoGood to 1
- end if
- DBSkip(1)
- if the result <> 0 then
- set resultfound to 0
- end if
- end repeat
- end if
- if CDXSomething = 0 then
- put EMPTY into field "CDNothingfound"
- put "Nothing found for:" into line 1 of field "CDNothingfound"
- put ".................................................................." into line 2 of field "CDNothingfound"
- put "Name:" && CDXWordsearchdata into line 3 of field "CDNothingfound"
- repeat with t = 1 to count(CDXWhichTypesList)
- set Whichfield to getAt(getAt(CDXWhichTypesList, t), 1)
- repeat with a = 1 to count(WhichINXtypenamesList)
- if getAt(getAt(WhichINXtypenamesList, a), 1) = Whichfield then
- set Whichfield to getAt(getAt(WhichINXtypenamesList, a), 2)
- exit repeat
- end if
- end repeat
- put Whichfield & ":" && getAt(getAt(CDXWhichTypesList, t), 2) into line t + 3 of field "CDNothingfound"
- end repeat
- set the boxType of member "CDNothingfound" to #adjust
- set the textSize of member "CDNothingfound" to 12
- set the margin of member "CDNothingfound" to 2
- set the border of member "CDNothingfound" to 1
- if the machineType > 200 then
- set the textFont of member "CDNothingfound" to "arial"
- else
- set the textFont of member "CDNothingfound" to "Geneva"
- end if
- set the textStyle of line 1 of member "CDNothingfound" to "bold"
- repeat with t = 3 to the lineCount of member "CDNothingfound"
- set the textStyle of word 1 of line t of member "CDNothingfound" to "bold"
- set the textStyle of word 2 of line t of member "CDNothingfound" to "plain"
- end repeat
- updateStage()
- set the castNum of sprite 34 to the number of member "CDNothingfound"
- set the loc of sprite 34 to point(30, 134)
- set the castNum of sprite 35 to the number of member "NothingGraphic"
- set the loc of sprite 35 to point(217, 156)
- updateStage()
- end if
- end
-