Slight problem calling a dialogue in a function.

Started by alphadalekben, Sat 02/05/2015 15:36:46

Previous topic - Next topic

alphadalekben

Shoot me for being thick, but I have a very minor (I'll admit as much) problem with a function. The 'faulty' code is the following;

Code: ags

function CarbonsOffice_OnClick(GUIControl *control, MouseButton button)
{
  dCarbonOffice.Start; 
}


The error is the following:
GlobalScript.asc(887): Error (line 887): '(' expected

I am aware that this is a minor issue, but it's such a minor issue that I can't see what on earth the problem could be.

Sorry to be a pain,
alphadalekben

ChamberOfFear

The error message says that you are missing parenthesis so that narrows it down quite a bit. You're trying to call the function "Start()" without parenthesis, all functions must have this.

Code: ags

function CarbonsOffice_OnClick(GUIControl *control, MouseButton button)
{
  dCarbonOffice.Start(); // See the difference here
}

alphadalekben

Oooooooh, I see now. Thanks for that. I knew it would be something simple like that. My bad. Sorry about that.

SMF spam blocked by CleanTalk