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.

Newcomers DBPro Corner / whats wrong with this simple code?

Author
Message
SnowBoardin360
14
Years of Service
User Offline
Joined: 29th Nov 2009
Location:
Posted: 31st Jan 2010 03:12 Edited at: 31st Jan 2010 03:20
i'm a noob at coding and I just was testing this and was wondering why isn't it working?



it says "command out of place at line 17"
and when I change it up to...



it says "could not close nest at line 15"

btw if you see anything else wrong with my code tell me.

You don't fight war for your contry, you don't fight war for your Queen, you fight war for the person beside you.
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 31st Jan 2010 04:13 Edited at: 31st Jan 2010 04:16
Here's my code for your problem.


I believe it's your IF/ENDIF block that is giving you problems. One thing I did different was set another variable C to be the sum of A and B so I can test my answer that was entered.
Since we are only testing againest one value but want it to loop with the player given the option to answer again until he gets it right you will want an Else to go along with that.
So your IF/ELSE block will look something like this.
With the above you could write a program like this to generate random values.



I am Batman!

Login to post a reply

Server time is: 2024-09-28 14:30:04
Your offset time is: 2024-09-28 14:30:04