home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 August / Personal_Computer_World_Aug_97.iso / dxrs / refpcw08.dxr / 00058_REFFeatureDatabase.ls < prev    next >
Encoding:
Text File  |  1997-05-16  |  5.2 KB  |  170 lines

  1. on REFFeatureDatabase
  2.   global searchdata, wordlist, resultlist, fieldnames, fieldlengths, category, supplier, product, platform, depth, issue, page, contact, recordsfound, originalrefsprite, selectiveoptions, REFDatabaseSpriteInfo, REFMGXNAme, DriveLtr
  3.   put " " into field "searchdata"
  4.   set the boxType of member "searchdata" to #fixed
  5.   set the textFont of member "searchdata" to "Arial"
  6.   set the textSize of member "searchdata" to 12
  7.   set the wordWrap of member "searchdata" to 0
  8.   put EMPTY into field "searchdata"
  9.   updateStage()
  10.   put " " into field "category"
  11.   set the textFont of member "category" to "Arial"
  12.   set the textSize of member "category" to 11
  13.   put " " into field "supplier"
  14.   set the textFont of member "supplier" to "Arial"
  15.   set the textSize of member "supplier" to 11
  16.   put " " into field "product"
  17.   set the textFont of member "product" to "Arial"
  18.   set the textSize of member "product" to 11
  19.   put " " into field "platform"
  20.   set the textFont of member "platform" to "Arial"
  21.   set the textSize of member "platform" to 11
  22.   put " " into field "depth"
  23.   set the textFont of member "depth" to "Arial"
  24.   set the textSize of member "depth" to 11
  25.   put "abcd " into field "issue"
  26.   set the textFont of member "issue" to "Arial"
  27.   set the textSize of member "issue" to 11
  28.   put " " into field "page"
  29.   set the textFont of member "page" to "Arial"
  30.   set the textSize of member "page" to 11
  31.   put " " into field "contact"
  32.   set the textFont of member "contact" to "Arial"
  33.   set the textSize of member "contact" to 11
  34.   updateStage()
  35.   put EMPTY into field "category"
  36.   put EMPTY into field "supplier"
  37.   put EMPTY into field "product"
  38.   put EMPTY into field "platform"
  39.   put EMPTY into field "depth"
  40.   put EMPTY into field "issue"
  41.   put EMPTY into field "page"
  42.   put EMPTY into field "contact"
  43.   set REFDatabaseSpriteInfo to list([182, 35, 53, 0], [183, 30, 90, 36], [184, 160, 90, 36], [185, 250, 90, 36], [186, 350, 90, 36], [187, 380, 90, 36], [188, 450, 90, 36], [189, 480, 90, 36], [190, 515, 90, 36], [191, 270, 60, 0], [192, 2000, 318, 0], [193, 2000, 318, 0], [221, 520, 51, 0], [11, 0, 0, 0], [11, 0, 0, 0], [195, 92, 326, 36], [197, 205, 326, 36], [199, 287, 326, 36])
  44.   set selectiveoptions to list(1, 1, 1)
  45.   set the castNum of sprite 39 to 64
  46.   repeat with g = 26 to 37
  47.     set the castNum of sprite g to getAt(getAt(REFDatabaseSpriteInfo, g - 25), 1)
  48.     set the locH of sprite g to getAt(getAt(REFDatabaseSpriteInfo, g - 25), 2)
  49.     set the locV of sprite g to getAt(getAt(REFDatabaseSpriteInfo, g - 25), 3)
  50.     set the ink of sprite g to getAt(getAt(REFDatabaseSpriteInfo, g - 25), 4)
  51.   end repeat
  52.   repeat with g = 10 to 15
  53.     set the castNum of sprite g to getAt(getAt(REFDatabaseSpriteInfo, g + 3), 1)
  54.     set the locH of sprite g to getAt(getAt(REFDatabaseSpriteInfo, g + 3), 2)
  55.     set the locV of sprite g to getAt(getAt(REFDatabaseSpriteInfo, g + 3), 3)
  56.     set the ink of sprite g to getAt(getAt(REFDatabaseSpriteInfo, g + 3), 4)
  57.   end repeat
  58.   updateStage()
  59.   set fieldnames to list("SOFTWARE/H", "PRODUCT_CA", "MANUFACTUR", "PRODUCT", "PLATFORM", "DEPTH", "ISSUE", "PAGE", "CONTACT/PH")
  60.   set fieldlengths to list(8, 12, 15, 20, 8, 12, 6, 3, 15)
  61.   set wordlist to list()
  62.   set resultlist to list([0, 0, 0, 0, 0, 0, 0])
  63.   set searchdata to EMPTY
  64.   put "Page 0 of 0" into field "pagexofy"
  65.   updateStage()
  66.   dbopensession()
  67.   if the machineType > 200 then
  68.     dbuse(DriveLtr & "DBFs\" & REFMGXNAme)
  69.     updateStage()
  70.   else
  71.     dbuse(DriveLtr & "DBFs:" & REFMGXNAme)
  72.   end if
  73. end
  74.  
  75. on DBGo recnum
  76.   DBCheckActive()
  77.   return FileFlex("10", string(recnum))
  78. end
  79.  
  80. on DBCurrRecNum
  81.   DBCheckActive()
  82.   return FileFlex("21")
  83. end
  84.  
  85. on DBClose dbID
  86.   DBCheckActive()
  87.   return FileFlex("4", string(dbID))
  88. end
  89.  
  90. on DBSkip num
  91.   DBCheckActive()
  92.   return FileFlex("14", string(num))
  93. end
  94.  
  95. on DBGetFieldByName fieldName, decryptFlag, key
  96.   DBCheckActive()
  97.   if the paramCount = 1 then
  98.     return FileFlex("26", fieldName)
  99.   else
  100.     return FileFlex("26", fieldName, decryptFlag, key)
  101.   end if
  102. end
  103.  
  104. on DBQuery expr
  105.   DBCheckActive()
  106.   return FileFlex("35", expr)
  107. end
  108.  
  109. on DBCheckActive
  110.   global gdbactive1030
  111.   if gdbactive1030 <> "true" then
  112.     set dummy to dbopensession()
  113.   end if
  114. end
  115.  
  116. on DBListFields
  117.   DBCheckActive()
  118.   return FileFlex("29")
  119. end
  120.  
  121. on dbopensession
  122.   global gdbactive1030
  123.   if gdbactive1030 <> "true" then
  124.     set gdbactive1030 to "true"
  125.     return FileFlex("1")
  126.   else
  127.     return "0"
  128.   end if
  129. end
  130.  
  131. on DBCloseSession
  132.   global gdbactive1030
  133.   if gdbactive1030 = "true" then
  134.     set gdbactive1030 to EMPTY
  135.     return FileFlex("2")
  136.   else
  137.     return "0"
  138.   end if
  139. end
  140.  
  141. on dbuse dbName, pathspec
  142.   DBCheckActive()
  143.   if the paramCount = 1 then
  144.     return FileFlex("3", dbName)
  145.   else
  146.     return FileFlex("3", dbName, pathspec)
  147.   end if
  148. end
  149.  
  150. on DBCount
  151.   DBCheckActive()
  152.   return FileFlex("19")
  153. end
  154.  
  155. on searchdata
  156.   global searchdata, wordlist
  157.   if the key = RETURN then
  158.     dontPassEvent()
  159.     set countwords to the number of words in field "searchdata"
  160.     set searchdata to word 1 to countwords of field "searchdata"
  161.     add(wordlist, searchdata)
  162.     PerformSearch()
  163.     set searchdata to EMPTY
  164.     set the editableText of sprite 26 to 0
  165.     set the keyDownScript to EMPTY
  166.   else
  167.     set searchdata to field "searchdata"
  168.   end if
  169. end
  170.