• 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 - IDE [SOLVED] Compile Error Doesn't Make Sense


I'm getting a compile error that is unrelated to the actual code it points to. Here's the error:

Script: InitMacros at line 16 : Symbol , or ) expected
Script: InitMacros at line 16 : Symbol ) expected
Script: InitMacros at line 16 : wrong number of arguments for function draw_text

Here's the script in question:

/// @desc InitMacros
    Initializes Game Macros

#macro K_RIGHT keyboard_check_pressed(vk_right);
#macro K_LEFT keyboard_check_pressed(vk_left);
#macro K_DOWN keyboard_check_pressed(vk_down);
#macro K_UP keyboard_check_pressed(vk_up);
#macro K_ENTER keyboard_check_pressed(vk_enter);

//Menu Positions
#macro MP_X 320;
#macro MP_Y 350;
#macro SEL_X 400; <----Line 16 that the error refers to
#macro SEL_Y 575;

The script is called in the create event of my main controller object. The error didn't show up until I added the following line to the controller's draw GUI event:

draw_text(SEL_X, SEL_Y, global.decision_txt);
If I comment out that line, the error goes away. Is this a bug, or is it a programming mistake that I'm missing?

EDIT: Okay, I changed the draw call to this:

var dx = SEL_X;
var dy = SEL_Y;

draw_text(dx, dy, global.decision_txt);
and it worked without an error. What gives?

EDIT 2: Never mind, I just realized I was initializing the macros incorrectly. I shouldn't have put line terminators in the InitMacro script. One of the problems with trying to develop good habits, I guess, you forget when the exceptions to the rule occur.
Last edited: