• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code anyone has problems with variables in a with statement?

I've come across a strange bug - at least it seems to be a bug - in which the x and y variables of an instance within a with statement return the values of the actual current instance - not the instance the with statement refers to.

Has anyone else had the same experience?

My IDE is v2.2.0.343 and Runtime v2.2.0.261.
 

gnysek

Member
You mean you write
Code:
x = 15;
otherInstance.x = 20;
with (otherInstance) {
   show_debug_message(string(x));
}
And it returns 15 instead of 20 ?
 

FrostyCat

Redemption Seeker
I've never experienced this problem, and I don't think you should file any bug reports until you can provide code that readily demonstrates it.
 
Top