Two Questions About My Search Field

DunbarX at aol.com DunbarX at aol.com
Tue Jan 13 14:04:58 EST 2009


I dug up a very old gadget in HC that handled the delete key explicitly. 
There is a field "results" to display the dug up data. This is the field script 
with the string to build and find...

on keydown var
  put word 2 of the selectedchunk into cursorloc --to restore cursor later
  global clientlist -- a database
  send "keydown" && quote & var & quote to hypercard -- to effect the 
keystroke itself
  put empty into temp

  if chartonum(var) = 8 then  --HANDLES "DELETE"
  if length(line 1 of me) < 3 then exit to hypercard  -- ignore small entries
    get fullfind(clientlist,value of me,"false","true") -- do differently in 
Rev
    repeat with y = 1 to number(lines of it)
        put line item 2 of line y of it of clientlist & return after temp
    end repeat
    if temp = empty then put "Not found" into fld "results" -- another field
    else put temp into fld "results"
    select after char (cursorloc -2) of me --restore blinking cursor
    exit keydown
  end if

--HANDLES NORMAL ENTRIES
  if length(line 1 of me) < 3 then -- ignore small entries
    select after text of me
    exit to hypercard
  end if
  put line 1 of me into tofind
  get fullfind(clientlist,tofind,"false","true")
  repeat with y = 1 to number(lines of it)
      put line item 2 of line y of it of clientlist & return after temp
  end repeat
  if temp = "" then put "No such" && quote & tofind & quote into fld
"results"
  else
    set itemdelimiter to "¶"
    sort temp
    sort temp by item 1 of each
    put temp into fld "results"
  end if
  select after char cursorloc of me
end keydown


**************
A Good Credit Score is 700 or Above. See yours in 
just 2 easy steps! 
(http://pr.atwola.com/promoclk/100000075x1215855013x1201028747/aol?redir=http://www.freecreditreport.com/pm/default.aspx?sc=668072%26hmpgID=
62%26bcd=DecemailfooterNO62)



More information about the Use-livecode mailing list