Hello,I'm wondering how can a variable be passed by reference instead of value in skill functions ?Regards,David
Hi David,In fact all variables [u]are [/u] passed by reference in SKILL. This is fairly obvious when passing lists, structures, tables, arrays and so on - but less obvious when passing "atomic" values such as integers, floats and strings - primarly because of the fact that there aren't functions to change a value of an atomic value in place.The purpose of you asking is probably to allow the function you're calling to change the value of a variable passed in. There are several ways this can be done:1. If the data passed is a list, structure, table, array, class instance, database object etc, then you can change it already. With lists you'd need to use a destructive operation (e.g. rplaca, rplacd and so on).2. You could write a macro instead of a function (see sourcelink solution 11025352 for an overview of macros)3. You could pass the name of the variable to the function. This is sort of equivalent to pointers in other languages. For example:procedure(MYupdateVar(varName "s") set(varName symeval(varName)+1))a=1MYupdateVar('a)a => 2Regards,Andrew.
Thanks for the details.David