populating a var instead of directly a field don't working ???

SparkOut SparkOutYNY at gmail.com
Tue Jan 27 04:39:46 EST 2009




Sarah Reichelt-2 wrote:
> 
>> In a stack I have two fields :
>>
>> One, « towns » is a list of towns where when a line is clisked, I put the
>> name of the town in « tthisTown »
>>
>> The other field « statClients», is a big list each line of which includes
>> a
>> number of items separated with tab ; the first item being the town.
>>
>> I wish to get in a third field, say « results », only the lines
>> concerning
>> the clicked town.
> 
> How about using the filter command?
> 
> ON mouseUp
>    local tThisTown, tStatClients
>    lock screen
>    put value(the selectedLine) into tThisTown
>    put fld "statClients" into tStatClients
>    filter tStatClient with "*" & tThisTown & "*"
>    put tStatClient into fld "results"
> END mouseUp
> 
> The *'s at the start & end of the filter string mean that your town
> can occur anywhere in the line, not just at the beginning or end.
> 
> Cheers,
> 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
> 
> I was just going to post a filter command might be the most useful here,
> but just for reference, your results field was not being populated because
> you were using an "exit mouse up" to end the repeat loop when the find
> result was "not found". Therefore your list was being built up line by
> line with each find, but then the handler was exited after the last one,
> without being able to do anything with the results.
In those circumstances a REPEAT UNTIL (result is "not found") or REPEAT
WHILE (result <> "not found) type structure would be better. (You could also
use "exit repeat" in the if statement, rather than "exit mouseup" but a
conditional loop is probably neater.)

-- 
View this message in context: http://www.nabble.com/populating-a-var-instead-of-directly-a-field-don%27t-working-----tp21681811p21682271.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list