Page 1 of 1

function name variable?

PostPosted: Sat Feb 15, 2014 10:07 pm
by vtrix
since when is using a string variable in functions not possible?

i even tried with constant variable, nopes

has this been changed maybe?

Re: function name variable?

PostPosted: Sun Feb 16, 2014 2:45 am
by danialgoodwin
@vtrix, in the past twenty releases I've used, I don't think it was ever possible. Just, about 5-10 or so releases ago, a using a constant string variable didn't give an error until compile-time, as opposed to at the time you add it.

Re: function name variable?

PostPosted: Sun Feb 16, 2014 3:11 am
by AllanR
@vtrix, I am not sure exactly what you mean... I just tried half a dozen ways of using a string variables with functions and they all worked.
I passed a string variable in as a parameter, accessed a global string variable, and even called a function by assigning the name of the function I wanted to call in a string variable.

(I am running version 161)

Re: function name variable?

PostPosted: Sun Feb 16, 2014 10:01 am
by vtrix
@danialgoodwin

i think it worked with rex function in the early days, i didn't need this because i wasn't using functions alot but now it would be helpfull

@AllanR

its on function "name" , i want it to be a variable
so i can rename my funtions more easy

does that work for you?

Re: function name variable?

PostPosted: Sun Feb 16, 2014 5:54 pm
by Aphrodite
[QUOTE=vtrix] @danialgoodwin

i think it worked with rex function in the early days, i didn't need this because i wasn't using functions alot but now it would be helpfull

@AllanR

its on function "name" , i want it to be a variable
so i can rename my funtions more easy

does that work for you?
[/QUOTE]
@vtrix

Never worked for me to set the function, however, I think you can call functions with a variable (not sure about that).

Maybe a dictionnary can work for that?Aphrodite2014-02-16 17:54:46

Re: function name variable?

PostPosted: Sun Feb 16, 2014 6:24 pm
by matthew0257
There is a typo I have made before:

Make sure the variable of the function name is NOT in quotes, or else the system will make the decision ""name""=/="name"

Re: function name variable?

PostPosted: Mon Feb 17, 2014 3:31 am
by vtrix
@Aphrodite

yes calling works, but to be usefull, on funtion "string" should take the string of the variable

this way you can just rename the functions at one place

not sure how a dictionnary would help... to keep track of my functions?

Re: function name variable?

PostPosted: Mon Feb 17, 2014 10:11 am
by Aphrodite
[QUOTE=vtrix] @Aphrodite

yes calling works, but to be usefull, on funtion "string" should take the string of the variable

this way you can just rename the functions at one place

not sure how a dictionnary would help... to keep track of my functions?[/QUOTE]

Now that I think abut it, the dictionnary may be more confusing..

Personnally I like to have all functions in one event sheet, maybe you could do like this:

Global variable : FunctionName = "My function"
On Function "My Function"
Global variable : FunctionName = "My function2"
On Function "My Function2"

So you have the two things to edit in the same place

Then you call functions only with the global variables