Page 1 of 1

function parameters+appendation to name variables? possible?

Posted: March 26th, 2006, 3:09 am
by ScottG
last question for the weekend, you probably won't hear from me until next saturday. :)

so i can i use a parameter of a function to define a variable, but what if i want to append something to the name of the variable?

eg function(parameter)
{
var parameterComp = subFolder.items.addComp(etc);
var parameterDuration = etc
}

how do i get "Comp" appended to my parameter when declaring this variable? is this possible?

why needed?

Posted: March 26th, 2006, 5:40 pm
by redefinery
Scott,

First, why are you wanting to define variables in this way?

The "parameter" is just the local name for the value that you pass into the function, so if you're wanting names based on it, just type them out as you want. If you're passing in a name (prefix) and you're wanting to create variables with that prefix, there might be a way to do it.

Jeff

Posted: March 26th, 2006, 9:44 pm
by ScottG
yes, i was wanting to use the parameter as a prefix for a bunch of variables, but now i'm thinking it'll be easier for me at this stage just to type out all the values as parameters, even though there will be a lot of them.

thanks anyway!
scott.