Identify text from a text field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Identify text from a text field
What is the code for identifying certain words from a text field? (I also want to get the row number)
Re: Identify text from a text field
You can use -> lineoffset that will give you the line number (= row)
Code: Select all
...
put "whatever" into tWord2Search4
put lineoffset(tWord2Search4,fld "the textfield") into tLineNumber
answer tLineNumber
## Will give you the line number with the FIRST occurrence of that word or 0 (Zero),
## if the word is NOT in the text of the field
...
Re: Identify text from a text field
Hi.
Not sure what you mean about "identify". Here is a handler that "identifies" a word in a field 1. In a button script:
Craig
Not sure what you mean about "identify". Here is a handler that "identifies" a word in a field 1. In a button script:
Code: Select all
on mouseUp
ask "Find?"
find empty
repeat
find it in fld 1
put the foundChunk & return after temp
if the result = "not found" then exit repeat
end repeat
answer temp
end mouseUp
Re: Identify text from a text field
Hi. Thanks for the code. I would also like a code that gives "TRUE" or "FALSE" depending on whether the certain word is in the text
thanks
thanks
Re: Identify text from a text field
That is beautifully simple in LiveCode:
Code: Select all
answer tMyWord is in field 1
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com