[Gambas-user] Gambas "Best Practices"

charlesg charles at ...1784...
Mon May 26 08:53:34 CEST 2008


I too have been messing around with this. I loaded 20,000 stock records into
sqlite3 and used my search method on the 50char max non-indexed description
field. Bit tedious it was.

Things got much snappier with the following although I agree with Stephen
that you would have to watch performance in a large environment (fortunately
not my problem!) because of the repeated calls to the database engine . By
the 3rd digit, the search had caught up and displayed the result. 
'-------------------------------------------------------------------
PUBLIC SUB txtDesc_KeyRelease()
  DIM txtUpper AS String
  lstBox.Clear
  txtUpper = UCase(txtDesc.text)
  sql = "select * from stmaster where st_desc like '%" & txtUpper & "%'"
  res = conn.Exec(sql)
  FOR EACH res
    lstBox.Add(res!st_code & "," & res!st_desc)
  NEXT 
 END
'-------------------------------------------------------------------

I agree with Richard that there is a need to help newcomers (like myself)
particularly on the now non-Francophone side of the divide! I must say I
find bits of code a great help rather than a bland description of procedure.

-- 
View this message in context: http://www.nabble.com/Gambas-%22Best-Practices%22-tp17323065p17466709.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list