Creating a customkey from a variable
Bob Sneidar
bobs at twft.com
Wed Apr 27 13:07:36 EDT 2011
Not sure if this is relevant, but putting "Math" into testname is going to have no effect on setting a property of the stack called testname. There will be a variable containing "Math" and that is all.
Further, you have to create the array as a variable first:
put "score" into testname[student]
set the testname of this stack to testname -- probably a bad idea to have a variable and a property named the same thing
The point here is that you cannot update properties directly. You have to put a property into a variable:
put the testname of this stack into myTestname
then update the variable:
put "Math" into mytestname["student"]
then set the property:
set the testname of this stack to myTestName
Bob
On Apr 27, 2011, at 9:27 AM, Glen Bojsza wrote:
> Hello,
>
> Hopefully someone is still looking at the list while the conference is going
> on...
>
> I want to create a customkey from a variable.
>
> on mouseup
> put "Math" into testname
> set the testname[student] of this stack to score
> end mouseup
>
> this doesn't create the customkey or properties for me but if I don't use a
> variable it will work?
>
> on mouseup
> set the Math[student] of this stack to score
> end mouseup
>
> I really would like to use a variable so I can automatically create the
> customkeys on the fly.
>
> Any suggestions?
>
> regards,
>
> Glen
> _______________________________________________
> 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