daily pastebin goal
87%
SHARE
TWEET

GML Scope resolution bug

a guest Aug 12th, 2017 63 in 59 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ///Parent Create Event
  3. myvar = "World!";
  4.  
  5. if(true) {
  6.     var myvar = "Hello";
  7.     show_debug_message(myvar);
  8. }
  9.  
  10. ///Child Create Event
  11. event_inherited();
  12. //This causes a fatal error saying myvar is not set before reading.
  13. show_debug_message(myvar);
  14.  
  15. ///Child Step Event
  16. //This properly prints "World!" to the IDE console
  17. show_debug_message(myvar);
RAW Paste Data
Top