Referencing

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Referencing

Glen Bojsza
Hi,

I have a field that contains a list of several fields that I want to
do a line count on.

FIELD UPDATELIST
fld "exportdata" of stack "map"
fld "sitename" of stack "map"
...
...

In my script I want to get the number of lines that each field currently has

on mouseUp
put fld UPDATELIST into uLists
repeat for each line M in uLists
put the number of lines in M
end mouseUp

The result I get is
1

Obviously I thought that this would be the same as

put the number of lines in fld "exportdata" of stack "map"
etc

Any ideas where my logic has gone off?

thanks
_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: Referencing

Arthur Urban
> I have a field that contains a list of several fields that I
> want to do a line count on.
>
> FIELD UPDATELIST
> fld "exportdata" of stack "map"
> fld "sitename" of stack "map"
> ...
> ...
>
> In my script I want to get the number of lines that each
> field currently has
>
> on mouseUp
> put fld UPDATELIST into uLists
> repeat for each line M in uLists
> put the number of lines in M
> end mouseUp
>
> The result I get is
> 1

Is it possible that the last field in your list in fact has only 1 line in
it?

Looking at your repeat loop, things might be going by so fast in the message
box that you only get to see the last iteration. You might try:

   put the number of lines in M & "," after msg

Not sure of my syntax exactly, but I hope you see where I'm headed.

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Referencing

Björnke von Gierke
In reply to this post by Glen Bojsza

On Jun 14 2005, at 22:24, Glen Bojsza wrote:
> on mouseUp
> put fld UPDATELIST into uLists
> repeat for each line M in uLists
> put the number of lines in M
> end mouseUp

Instead try:

on mouseUp
   put fld "UPDATELIST" into uLists
   repeat for each line M in uLists
     put the number of lines in field M
   end repeat
end mouseUp

notice the "end repeat", and especially the "field" before the "M".
Also you might want to try this instead, to see all fields one after
another:

on mouseUp
   put ""
   put fld "UPDATELIST" into uLists
   repeat for each line M in uLists
     put M && the number of lines in field M & return after msg
   end repeat
end mouseUp


--

http://contest.wecode.org
Now running: the first ChatRev coding contest!
sponsors:
Altuit
Andre Garzia
Karl Becker
Runtime Revolution
TidBITS in cooperation with eHUG

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution