arrays (again)
Tariel Gogoberidze
PMDA at earthlink.net
Mon Apr 22 02:17:01 EDT 2002
> Message: 13
> Date: Sun, 21 Apr 2002 10:31:38 +0200
> From: yves COPPE <yvescoppe at skynet.be>
> Subject: Re:arrays (again)
> >
> >on mouseUp
> > put the short name of this stack into MYstackName
> > put the cData ["student","name","3"] of stack MYstackName
> >end mouseUp
> >
> >Best regards
> >Tariel Gogoberidze
>
> Ok, that works fine now.
> Another question : is it possible to go further in the manipulation of the data
>
> for example
>
> put the cdata["student","name"] of stack MyStackName into fld xxx
>
> doesn't work.
>
> I'd like to get the complete list of the names, not only the number
> "3" as in this axample, but the full list. So I've tried the line of
> script here above, but I get nothing.
> Yves COPPE
Try this. It should be more efficient way to do this but this example
should work
on mouseUp
put "Mark,Ann,Jim,kevin" into myvarOne
put myvarOne into temp
repeat with i = 1 to the number of items of temp
put item i of temp into myData["Student","name",i]
end repeat
put "Kate,Antonio,Scott" into myvarTwo
put myvarTwo into temp
repeat with i = 1 to the number of items of temp
put item i of temp into myData["prof","name",i]
end repeat
set the customProperties["cData"] of this stack to myData
put the short name of this stack into MYstackName
-- put the cData ["student","name","3"] of stack MYstackName into OneElement
set the customPropertySet of stack MYstackName to "cData"
put customkeys of stack MYstackName into MyList
set the customPropertySet of stack MYstackName to empty -- to set it
back to default custom properties
repeat with j= 1 to number of lines of MyList
put the cData [line j of MyList] of stack MYstackName into line j
of MyListContent
end repeat
put MyListContent & cr & "=====" &cr & mylist
end mouseUp
Best Regards
Tariel Gogoberidze
More information about the use-livecode
mailing list