Can you hilite the Find commands found text?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Can you hilite the Find commands found text?
I’m using the Find command to find segments of text within a larger body of text. As you know, when the desired segment is found, the Find command puts a “boxâ€
urbaud
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
See the foundText function.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
You can use the foundText chunk description to do anything you want with the chunk; you can select it, or set its backgroundColor, etc.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Hi Richard,
Can you direct me to a link that will show me the syntax to change the background color of the foundText chunk , the dictionary doesn't show how to do that. By the way, what is it with the dictionary-many times I look something up and try the examples and they don't work. For example, the dictionary has the line: "the foundText" as part of the example, but if I put it into an onMouseUp handler, it generates an error message. Do you know of a good source for Revolution syntax, if so, what is it. I find the information about Revolution commands, functions, etc sorely lacking. I have Schaffers book and it is somewhat helpful, but I wish there was some other good source. I have looked at the course stuff from BYU-it's pretty good. Any further help you can provide would be much appreciated.
Can you direct me to a link that will show me the syntax to change the background color of the foundText chunk , the dictionary doesn't show how to do that. By the way, what is it with the dictionary-many times I look something up and try the examples and they don't work. For example, the dictionary has the line: "the foundText" as part of the example, but if I put it into an onMouseUp handler, it generates an error message. Do you know of a good source for Revolution syntax, if so, what is it. I find the information about Revolution commands, functions, etc sorely lacking. I have Schaffers book and it is somewhat helpful, but I wish there was some other good source. I have looked at the course stuff from BYU-it's pretty good. Any further help you can provide would be much appreciated.
urbaud
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Dude, ya' gotta experiment. You'll be surprised by how easy these types of things are in Rev, and the more you experiment the quicker you'll get the hang of it.
We know from the dictionary entry for foundChunk that it returns a description that uses a chunk expression, and that we can assign the background color to a portion of a field's text using a chunk expression, so putting the two together gives us:

We know from the dictionary entry for foundChunk that it returns a description that uses a chunk expression, and that we can assign the background color to a portion of a field's text using a chunk expression, so putting the two together gives us:
Code: Select all
on mouseUp
find "something" in fld 1
set the backgroundcolor of the foundChunk to "blue"
end mouseUp

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn