Put "test2" into field "Attendance" of last marked card of stack "Kids"

Bob Sneidar bobs at twft.com
Mon Jul 16 13:27:52 EDT 2012


Yup. What you are trying to do is called Enumeration, and is an Applescript feature. Other languages may also have some form of it, but I am inexperienced there. Livecode does very limited enumeration. But since using a repeat loop is really quite fast, especially if when navigating you lock the screen and lock messages, there isn't much of an advantage of building enumeration into the engine. 

Bob


On Jul 16, 2012, at 3:44 AM, Mark Rauterkus wrote:

> Hi,
> 
> This works:
> put "test1" into field "Attendance" of first marked card of stack "Kids"
> 
> This works:
> put "test2" into field "Attendance" of last marked card of stack "Kids"
> 
> BUT, this does not:
> 
> put "test3" into field "Attendance" of all marked cards of stack "Kids"
> 
> FAIL too.
> put "test3" into field "Attendance" marked cards of stack "Kids"
> 
> - - -
> 
> So, I'd love to put a message into ALL of the Marked Cards
> 
> Must I do a repeat script?
> 
> But my repeat script is failing too, with and without quotes for the vars.
> 
> 
> on mouseUp tRepeat, tCounter, test1
>   put "AM TEST 1" into test1
>   go to stack "Kids"
>   mark cards by finding "Greece" in field "Dreamers Class" -- of stack "Kids"
>   mark cards by finding "Canada" in field "Dreamers Class"
> 
> 
>   Get the number of marked cards
>   put it into tRepeat
> 
>   put "0" into tCounter
>   Repeat for tRepeat
>      put 1 into tCounter -- the counter
>      put "test1" into field "Attendance" of "tCounter" marked cards
>      go to next marked card
>   end repeat
> 
>   beep
> 
> end mouseUp
> 
> 
> Error in script debugger says:
> button "test 1": compilation error at line 15 (Chunk: missing chunk)
> near "tCounter", char 43
> 
> 
> 
> --
> Ta.
> 
> 
> Mark Rauterkus       Mark.Rauterkus at gmail.com
> PPS Summer Dreamers' Swim and Water Polo Camp Head Coach with
> Neighborhood Learning Alliance
> 
> http://NeighborhoodLearning.org
> 
> http://Rauterkus.blogspot.com
> http://FixPA.wikia.com
> http://CLOH.wikia.com
> 412 298 3432 = cell
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list