home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 September / Personal_Computer_World_Sep_97.iso / DXRS / RVXPCW09.DXR / 00011_RVXSetCriteria,RVXdoSelect,RVXAddSelection.ls < prev    next >
Encoding:
Text File  |  1997-06-25  |  4.0 KB  |  124 lines

  1. on RVXSetCriteria x, a, b, C, d, e, f, g, h, i, j, k
  2.   global RVXTable, RVXDB, RVXNothingfound, RVXHardList
  3.   if getAt(RVXHardList, 1) = getAt(RVXHardList, 2) then
  4.     set the member of sprite 34 to member "RVXCross"
  5.     set the member of sprite 35 to member "RVXCross"
  6.     set the loc of sprite 34 to point(400, 64)
  7.     set the loc of sprite 35 to point(400, 91)
  8.     set the ink of sprite 34 to 0
  9.     set the ink of sprite 35 to 0
  10.     setAt(RVXHardList, 1, 1)
  11.     setAt(RVXHardList, 2, 1)
  12.     set check to 0
  13.   else
  14.     if getAt(RVXHardList, 1) = 1 then
  15.       set check to 1
  16.     else
  17.       set check to 2
  18.     end if
  19.   end if
  20.   updateStage()
  21.   set RVXTable to 0
  22.   set RVXDB to 0
  23.   set RVXfact to xtra("V12dbe")
  24.   set RVXDB to new(RVXfact, the pathName & "PCWMGX.V12", "ReadWrite", "MGINDEX")
  25.   if not objectp(RVXDB) then
  26.     alert("Cannot create Database instance1. Err=" && RVXDB)
  27.     exit
  28.   end if
  29.   set RVXfactTwo to xtra("V12table")
  30.   set RVXTable to new(RVXfactTwo, mGetRef(RVXDB), "MGTABLE")
  31.   if not objectp(RVXTable) then
  32.     alert("Cannot create V12table instance2. Err=" && RVXTable)
  33.   end if
  34.   case x of
  35.     1:
  36.       set err to mSetCriteria(RVXTable, a, b, C)
  37.       case check of
  38.         1:
  39.           set err to mSetCriteria(RVXTable, "and", "Software/Hardware", "=", "hardware")
  40.         2:
  41.           set err to mSetCriteria(RVXTable, "and", "Software/Hardware", "=", "software")
  42.       end case
  43.     2:
  44.       set err to mSetCriteria(RVXTable, a, b, C)
  45.       set err to mSetCriteria(RVXTable, d, e, f, g)
  46.       case check of
  47.         1:
  48.           set err to mSetCriteria(RVXTable, "and", "Software/Hardware", "=", "hardware")
  49.         2:
  50.           set err to mSetCriteria(RVXTable, "and", "Software/Hardware", "=", "software")
  51.       end case
  52.     3:
  53.       set err to mSetCriteria(RVXTable, a, b, C)
  54.       set err to mSetCriteria(RVXTable, d, e, f, g)
  55.       set err to mSetCriteria(RVXTable, h, i, j, k)
  56.       case check of
  57.         1:
  58.           set err to mSetCriteria(RVXTable, "and", "Software/Hardware", "=", "hardware")
  59.         2:
  60.           set err to mSetCriteria(RVXTable, "and", "Software/Hardware", "=", "software")
  61.       end case
  62.   end case
  63.   RVXdoSelect()
  64.   RVXAddSelection()
  65.   if RVXNothingfound = 0 then
  66.     RVXFieldResults()
  67.     RVXShowResults()
  68.   else
  69.     case x of
  70.       1:
  71.         set the member of sprite 7 to member "RVXANDORYellow"
  72.       2:
  73.         set the member of sprite 11 to member "RVXANDORYellow"
  74.     end case
  75.   end if
  76. end
  77.  
  78. on RVXdoSelect
  79.   global RVXTable
  80.   set err to mSelect(RVXTable)
  81. end
  82.  
  83. on RVXAddSelection
  84.   global RVXTable, RVXrecordsfound, RVXresultlist, RVXpageselect, RVXNothingfound, RVXSub
  85.   set RVXresultlist to list()
  86.   set RVXrecordsfound to mSelectCount(RVXTable)
  87.   if RVXrecordsfound = 0 then
  88.     set RVXNothingfound to 1
  89.     set the member of sprite 32 to member "RVXNothingFound"
  90.     set the loc of sprite 32 to point(295, 367)
  91.     set the ink of sprite 32 to 36
  92.     updateStage()
  93.   else
  94.     set RVXNothingfound to 0
  95.     set temp to mGetPosition(RVXTable)
  96.     mGoFirst(RVXTable)
  97.     put EMPTY into field "RVXRESType"
  98.     put EMPTY into field "RVXRESProd"
  99.     put EMPTY into field "RVXRESSupp"
  100.     put EMPTY into field "RVXRESDept"
  101.     put EMPTY into field "RVXRESCate"
  102.     put EMPTY into field "RVXRESissu"
  103.     put EMPTY into field "RVXRESPage"
  104.     put EMPTY into field "RVXRESCont"
  105.     repeat with i = 1 to RVXrecordsfound
  106.       set type to mGetField(RVXTable, "Software/Hardware")
  107.       set Product to mGetField(RVXTable, "Product")
  108.       set Supplier to mGetField(RVXTable, "Manufacturer/ Distributor")
  109.       set depth to mGetField(RVXTable, "Depth")
  110.       set Category to mGetField(RVXTable, "Product Category")
  111.       set Issue to mGetField(RVXTable, "Issue")
  112.       set Page to mGetField(RVXTable, "Page")
  113.       set Contact to mGetField(RVXTable, "Contact/Phone Number")
  114.       addAt(RVXresultlist, count(RVXresultlist) + 1, [type, Product, Supplier, depth, Category, Issue, Page, Contact])
  115.       mGoNext(RVXTable)
  116.     end repeat
  117.     if RVXrecordsfound > 18 then
  118.       set RVXpageselect to 1
  119.     else
  120.       set RVXpageselect to 0
  121.     end if
  122.   end if
  123. end
  124.