I doing a code like this:
function welldone_OnClick(GUI *theGui, MouseButton button)
{
if (bad6.Visible = false){ line 718
digipad_1.Visible = false;
welldone.Visible = true;
}
bad6 is the name of a button
but it say,
GlobalScript.asc(718): Error (line 718): Parse error in expr near 'bad6'
Can somebody tell me why this is happening and how to solve it please?
It's because you're using a single "=" instead of "==" in the if statement. "==" is used for comparing values, "=" for setting them.
It should be:
if (bad6.Visible == false) {
This is an error i had a lot when i started using AGS (and even now), since i usually work in Delphi, where " = "
is to compare and " := "
to assign values. We are lucky that AGS have a great debug tool.
Jp
Thanks for, thats really helpful :)