Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Error C2059 "if"

Author
Message
Bndit
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location:
Posted: 2nd Jul 2009 11:29
So I am trying to make a scrolling window, like if the player goes to far to the right the screen will scroll to the right like a top down RPG, but I keep getting this error.

error C2059: syntax error : 'if'

Here is all the code above it, and only seems to occur that one time.




Anyone know the problem????

Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 2nd Jul 2009 13:01


That is you problem "if" conditional ... in C++ a single = operator is an assignment operator, that means you are trying to tell the compiler that MoveScreenResult is equal to 1 inside an if loop and it doesnt like that kind of thing...

To fix it change it to :



Note the == operator, it is a comparison operator.

If it ain't broke.... DONT FIX IT !!!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 2nd Jul 2009 14:38
You also need a statement to follow the 'if'.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 2nd Jul 2009 15:59
I think he has more code, I think what is listed is only from above his error ?

But Zotoaster is right, if there is no other statement following that "if" conditional, it wont do anything.

If it ain't broke.... DONT FIX IT !!!
Bndit
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location:
Posted: 3rd Jul 2009 06:56
I already fixed it, I just misplaced a close bracket -_- I hate that stupid stuff.

Login to post a reply

Server time is: 2024-10-01 05:46:52
Your offset time is: 2024-10-01 05:46:52