[Scilab-users] Name of function's input arguments

Stéphane Mottelet stephane.mottelet at gmail.com
Thu May 30 00:24:06 CEST 2013


You can do it with the macrovar primitive.

S.

Le 29/05/13 22:56, Adrien Vogt-Schilb a écrit :
> you cannot.
>
> But you can provide the function directly with the name of your 
> variable, and transform te name of the variable into the variable by 
> evaluating it...
>
> function  f(nameofvar1,nameofvar2)
>
>     var1 = evstr(nameofvar1)
>     var2 = evstr(nameofvar2)
>     disp(nameofvar1 + " + "+ nameofvar2 +" is "+string(var1 +var2))
>
> endfunction
>
> a=5;
> b=7;
>
> f("a","b")
>
> On 29/05/2013 22:49, pierre vuillemin wrote:
>> Hello,
>>
>> I would like to know if there exists a way to get the name of 
>> function's inputs arguments, i.e., if I have the following function
>>
>> function y = f(a,b)
>> ..
>> endfunction
>>
>> and that I call it like y = f(var1,var2), is it possible to know, 
>> inside my function f, that the first input argument a is called 
>> "var1" and that the second one is called "var2" ?
>>
>> Pierre
>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130530/b54e5e65/attachment.htm>


More information about the users mailing list