Text in imageSource
Jim Ault
JimAultWins at yahoo.com
Thu Jan 26 04:23:09 EST 2006
Hi Sarah,
I am up for another half hour or so (until 8 pm thur your time) Let me know
if this technique is workable.
Did you make any progress on your challenge?
My guess is that the regEx is a bit slow for your use, now that I know you
are doing 700 lines with 700 hits or more.
Seems like you are sorting into categories (1-5) and that doing something
like the following my work:
My elapsed time is 3 ticks and the result is a midpoint of having six
variables each containing the same 'star.png' html string. Should be easy
to sort and combine these how you need it.
<paste into a container, or remove the comments>
on testt
put the ticks into startt
--building the 700+ lines to work with below
repeat until the number of lines in wholeThang > 700
put cr&"<img src=" & quote & "Star.png" & quote & "><img src=" "e &
"Dash.png" & quote & \
"><img src=" & quote & "Dash.png" & quote & "></p>" after of
wholeThang
put cr&"<img src=" & quote & "Star.png" & quote & "><img src=" "e &
"Star.png" & quote & \
"><img src=" & quote & "Dash.png" & quote & "></p>" after of
wholeThang
put cr&"<img src=" & quote & "Star.png" & quote & "><img src=" "e &
"Star.png" & quote & \
"><img src=" & quote & "Star.png" & quote & "></p>" after of
wholeThang
put cr&"<img src=" & quote & "Dash.png" & quote & "><img src=" "e &
"Dash.png" & quote & \
"><img src=" & quote & "Dash.png" & quote & "></p>" after of
wholeThang
end repeat
--parsing to get 6 groups then doing a count
put wholeThang into grp5
filter grp5 with "*star*star*star*star*star*" -- 5
filter wholeThang without "*star*star*star*star*star*"
put wholeThang into grp4
filter grp4 with "*star*star*star*star*" -- 4
filter wholeThang without "*star*star*star*star*"
put wholeThang into grp3
filter grp3 with "*star*star*star*" -- 3
filter wholeThang without "*star*star*star*"
put wholeThang into grp2
filter grp2 with "*star*star*" -- 2
filter wholeThang without "*star*star*"
put wholeThang into grp1
filter grp1 with "*star*" -- 1
filter wholeThang without "*star*"
put wholeThang into grp0
repeat with x = 0 to 5
do "get the number of lines in grp"&x
put ( it & " ["&x&"]" & cr) after output
end repeat
answer output &cr & (the ticks - startt) & " ticks elapsed"
breakpoint
end testt
Jim Ault
Las Vegas
On 1/25/06 10:58 PM, "Sarah Reichelt" <sarah.reichelt at gmail.com> wrote:
>> I had a field that would allow users to record their voices when they pressed
>> on a "0" and play their recording when the pressed on a ">" [I did this
>> because there were varying numbers of lines...long story]
>>
>> Later I wanted to put an image there to make it more understandable to the
>> user--I set the imagesource of that character.
>>
>> Here's the part that's interesting for you. When I moved my cursor over the
>> image, the script reacted as though the characters were still there.
>>
>> So... for your ranking field, put numbers for rank and then run a script that
>> sets the imagedata of those characters. You should still be able to sort the
>> field because the numbers still exist.
>>
>
> If I do it that way, the sort works perfectly, but it is too slow for
> the initial display. It takes about 20 seconds to do 700 lines this
> way, where using the htmlText method on a variable and then putting it
> all in the field takes less than 1 second.
>
> I am currently using the hidden column method, but I'll try Jacque's
> custom sort. I always forget about those but they can be really
> powerful.
>
> Thanks,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list