Code explains it :
i expected that i'd get "value" can i get "macaroni" ?
tx
EDIT :
what i'm trying to do is setup a wrapper around a variable or array and auto-assign the name the user has given it .
This is the best workaround i came up with ,but the user will be annoyed typing that in (the passvalueandname (the user has access to the source code))
Goal :
Temporary macro :
Why are you using a function and not directly the macro ?
#define findName(x) #x //template<typename X> //string findName(X &value) { // return(NAMEOF(value)); //} //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- int macaroni=0; string name=findName(macaroni); Print(name); }
Probably I don't understand what you are trying to achieve. Please provide code closer to your goal in this case.
Why are you using a function and not directly the macro ?
Probably I don't understand what you are trying to achieve. Please provide code closer to your goal in this case.
I've explained in the edit
Can i get the name of the variable / array that was passed to the function ?
And is there a macro for getting the typename ?- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Code explains it :
i expected that i'd get "value" can i get "macaroni" ?
tx
EDIT :
what i'm trying to do is setup a wrapper around a variable or array and auto-assign the name the user has given it .
This is the best workaround i came up with ,but the user will be annoyed typing that in (the passvalueandname (the user has access to the source code))
Goal :
Temporary macro :
Also is there a macro that gets the typename ?