Giuseppe,
I'm not completely sure of what you are asking. In the upcoming 0.14, I
have added the ability to create a complex object containing sub-elements
that are accessed using .property syntax. I wouldn't recommend trying to
use that until I release 0.14 though :>
Any 'complex' data variable is copied and stored by reference. Strings
and numbers are not complex; and so they just make copies of the values,
but lists are. So, if you make a copy of a list, and use SetElement to
change the list, it will get changed and any variable referring to it will
see the change.
define Start(p)
{
parameters <- ["one","two","three"]
parameterscopy <- parameters
##Right now, both refer to the same list object
SetElement(parameters,1,"uno")
SetElement(parameterscopy,2,"due")
Print(parameters)
Print(parameterscopy)
}
You will find that the same list ("uno, duo, three") prints out in both
cases. This will work even if the list is only a single element long.
However, you need to use SetElement to make this work.... doing:
parameterscopy <- ["one","two","three"]
will have no impact on the parameters variable.
Best,
Shane
> Dear Shane
> how can a make a true new variable of a complex data type, for which <-
> is just the pointer to the same variable.
>
> Thank you in advance and best regards,
> --
> Giuseppe Cabras, PhD - Chemistry, Physics and Environment Dept.
> InterUniversity Center for Behavioral Neurosciences http://icbn.uniud.it
> University of Udine - via delle Scienze, 206 - 33100 UDINE
> Phone: +39-043255-8212 - Fax: +39-043255-8222
> SMS: http://www.fisica.uniud.it/cabras/SMS.html
> URL: http://people.uniud.it/page/giuseppe.cabras
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform
> that
> developers love is also attractive to malware creators. Download this
> white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk_______________________________________________
> Pebl-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pebl-list
>
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Pebl-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pebl-list