home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 201 / DPCS1104.ISO / Full / QuickBooks / QBTutor / Lesson5 / Lesson5.dcr / 00176_auto-complete.ls < prev    next >
Encoding:
Text File  |  2001-02-01  |  828 b   |  33 lines

  1. property pLocalList, spriteNum
  2.  
  3. on beginSprite
  4.   pLocalList = sendSprite(spriteNum, #getMyDropDownList)
  5. end
  6.  
  7. on keyDown
  8.   if key() = TAB then
  9.     set the selStart to the selEnd
  10.     sendSprite(spriteNum, #doListSelect)
  11.   else
  12.     if pLocalList = VOID then
  13.       pLocalList = sendSprite(spriteNum, #getMyDropDownList)
  14.     end if
  15.     curPos = the selStart
  16.     t = char 1 to curPos of the text of the member of sprite(spriteNum)
  17.     t = t & key()
  18.     paz = "TRUE"
  19.     repeat with i = 1 to pLocalList.count
  20.       if t = char 1 to t.length of pLocalList[i] then
  21.         sprite(spriteNum).member.text = pLocalList[i]
  22.         set the selStart to curPos + 1
  23.         set the selEnd to pLocalList[i].length
  24.         paz = "FALSE"
  25.         exit repeat
  26.       end if
  27.     end repeat
  28.     if paz = "TRUE" then
  29.       pass()
  30.     end if
  31.   end if
  32. end
  33.