BTW you will get the contents of the entire line by using filter temp with
"*c*". As I mentioned it works with entire lines, not chunks of text.
If you are trying to see if "abcdef" contains "c" use "c" is in "abcdef". If
you are trying to find which character contains the first "c" use offset("c",
"abcdef"). If you are trying to find ALL the "c"'s in the string it gets
trickier. If the string HAS to be formatted that way, then you will need a
repeat loop.
put 0 into theCount
put "abcdef" into theString
repeat for each char theChar in theString
add one to theCount
if theChar is "c" then
put theCount & comma after thePositionList
end if
end repeat
delete the last char of thePositionList
optionally you could do this:
put "abcdef" into theString
repeat for each char theChar in theString
put theChar & cr after theNewString
end repeat
filter theNewString with "c"
I can't think of how that would be useful, but I don't know what you are doing.
Bob
On Dec 9, 2011, at 11:15 AM, [email protected] wrote:
>
>
> What am I doing wrong? If I have:
> on mouseup
> put "abcdef" into temp
> filter temp with "c"
> put temp
> end mouseup
> I get empty. I don't need more empty.
> Craig Newman
>
> _______________________________________________
> use-livecode mailing list
> [email protected]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode