populating a var instead of directly a field don't working ???
Andre.Bisseret at inria.fr
Tue Jan 27 05:01:55 CST 2009
Le 27 janv. 09 à 10:39, SparkOut a écrit :
> 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
>>> 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
>>> 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.
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> I was just going to post a filter command might be the most useful
>> but just for reference, your results field was not being populated
>> you were using an "exit mouse up" to end the repeat loop when the
>> result was "not found". Therefore your list was being built up line
>> line with each find, but then the handler was exited after the last
>> without being able to do anything with the results.
> In those circumstances a REPEAT UNTIL (result is "not found") or
> 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.)
Ooops ! YES ! very happy to eventually understand my mistake ;-))
Of course, you are right, exit repeat, not mouseUp.!
Anyway, I think I shall adopt the filter command
Thanks a lot for your attention and your revision
Best regards from Grenoble
> 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.
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode