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

Sarah Reichelt sarah.reichelt at gmail.com
Tue Jan 27 04:22:31 EST 2009


> 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



More information about the use-livecode mailing list