finding and styling a piece of text
Posted: Sat Oct 25, 2014 4:26 pm
just to point out i have already looked at these pages
http://lessons.runrev.com/m/4071/l/5867 ... vecode-5-5
http://lessons.runrev.com/m/4603/l/4409 ... -with-text
i want that when im filling in a text field it will look in a database. and start finding matches for what im typing as i type. ive got that good so far. What i want it to do though is to style the chunk or chunks of text in what was found.
if i type in "ha" it will find in the database "Michael" however i want it to find in the word and change the background color of "ha" within "Michael" i did a small text with "find" but it didnt draw a box around "ha" like i thought it would. This is my code. I store whats being typed into the custom property cExistChecker so that i can keep whats being typed and whats showing separate.
http://lessons.runrev.com/m/4071/l/5867 ... vecode-5-5
http://lessons.runrev.com/m/4603/l/4409 ... -with-text
i want that when im filling in a text field it will look in a database. and start finding matches for what im typing as i type. ive got that good so far. What i want it to do though is to style the chunk or chunks of text in what was found.
if i type in "ha" it will find in the database "Michael" however i want it to find in the word and change the background color of "ha" within "Michael" i did a small text with "find" but it didnt draw a box around "ha" like i thought it would. This is my code. I store whats being typed into the custom property cExistChecker so that i can keep whats being typed and whats showing separate.
Code: Select all
on newTabName
if visible of grp "TabCreate" is true then
put the cExistChecker of fld "tabPersonName" into tabzName
if tabzName <> empty then
put "SELECT tabname FROM tabs WHERE tabname LIKE '%"& tabzName &"%' ORDER BY tabname LIMIT 1 " into tdSQL
put revDataFromQuery(comma, cr, gConnectionID, tdSQL) into tData
if tData is empty then
set the text of fld "tabPersonName" to tabzName
else
set the text of fld "tabPersonName" to tData
end if
end if
find tabzName in fld "tabPersonName"
send "newTabName" to me in 0
end if
end newTabName