ID:2077628
 
(See the best response by Kaiochao.)
Code:
mob/proc/setStat( variable, argument )
if(variable in src.vars)
src[variable] = argument

setStat( level, src.level+1 )
//src.level += 1


Problem description:
What i am looking for is a proc i can use with an intention of modifying any variable live, for debugging purposes.

How do i change a variable for example /mob, with arguments in a proc. The proc is executed with two arguments, one for which variable is being changed and a second for which value i want to change to.

I have been gone for a long time, but i recently wished to get back for fun. Now i wanted to try create something again and i would appreciate if i get some help understanding my problem here. I don't know if the example is a good example, but hopefully you get the idea.
datum.vars is an associative list of variables (as text) paired with their values (as they are).

What you have is pretty close:
mob/proc/setStat(variable, argument)
if(variable in vars)
vars[variable] = argument
else
throw EXCEPTION("Invalid variable: [variable]")

// e.g. level = level + 1
setStat("level", level + 1)
Yes, I thought I had the right approach but the wrong execution for it.

Thank you, appreciate it (Y)
Best response
Also, I'd recommend throwing an exception if the variable isn't found, instead of silently returning. See my edit in my previous post.
Yes, good point.