Another way to do that, without using "other", is this:I know, I use it to. That's the type of code I was glancing at that made the idea pop into my head.
But I was looking at it and went "This isn't very clear. with is telling me that this is happening to another object, yet it's... not." It would just be neat to have something similar, and more apparent of what it's actually doing. Not necessarily the exact idea I proposed.
Or heck, if you were to use an idea like that one, just limit the scope of with to only include the object in with and have some keyword for getting the calling object:with (instance) { caller.variable = 0; }
Or whatever. Weird ideas for sure...
var me;
me = id;
with (instance)
{
me.variable = 0;
}Yes, that is an accurate description. As I said in a previous post, temporary variables behave like global variables, except they are temporary.I don't think a temporary variables counts as an instance variable. I don't know how you'd describe it, it's almost 'global', but only within a particular piece of code. (it ceases to exist outside that code/script, as you will know)
So using other.temp_variable doesn't make sense, because temporary variables don't *have* an instance they exist in.
This is my best guess. I should probably start testing around now, I'm relying on memory.. :tongue:
Edited by Big J, 20 April 2012 - 03:30 AM.



This topic is locked






