Script that automatically prints the name of a variable

K

kazudennis

Guest
Good day,
how can I create a script that automatically prints the name of a variable and its respective value in the debug.
I should just enter the variable in the script.
sorry for the english

i.e:
if vsp = 4
scr_message (vsp);
result;
vsp = 4
 

jackquake

Member
Code:
show_debug_message("vsp: "+string(vsp));
To my knowledge, the name of the variable is not accessible.
 
K

kazudennis

Guest
Thanks for answering, I wanted to do that so I did not put everything inside the show_debug_message.
 

Evanski

Raccoon Lord
Forum Staff
Moderator
No matter how you do it, you wont get the exact name of the variable because if you make Cookies = 4. then ask what Cookies is, you will only ever get 4, because Cookies is now 4. Your assigning the space labeled Cookies to hold 4. Cookies == 4. but 4 != Cookies.
 
Top