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 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
[email protected]
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.)

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
André




--
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
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution




_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to