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 AppGameKit Corner / If and ElseIf

Author
Message
AAChaoshand
4
Years of Service
User Offline
Joined: 12th Apr 2015
Location: Texas
Posted: 21st Apr 2015 01:45
Having a small problem. I had the code working before but I either don't see the problem in plain site or I'm not understanding something. Basically, within the new AGK2 Activities on Activity 6.4 I made some changes to the Guess program just to mess around and see things work. I understand what If statements are and how they keep going down the line until they hit EndIf terminating that If statement. I started using ElseIf with my If to make the code a bit cleaner and either screwed something up in the process or left something additional out. Hopefully someone can spot my error:



So the above code is the Guess activity modified over the course of the chapters. When I run the program, the statements within the If statements only run part of the time. Sometimes it will tell me I was "Way too High!"(Or to low, etc.) sometimes it won't then doesn't let me input to try again. The goal was to add a Repeat...Until statement but that isn't working for me. Am I missing something obvious or not comprehending If statements like I thought I was?
AAChaoshand
4
Years of Service
User Offline
Joined: 12th Apr 2015
Location: Texas
Posted: 21st Apr 2015 01:48 Edited at: 21st Apr 2015 01:51
Disregard, I'm stupid. I'm not printing the String....This is why I can't have nice things.

Revised code, don't need the String anymore since I'm doing something different.

Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Jun 2015 04:44
We all make mistakes like that. It's eventually finding such things that is one of the satisfying parts about programming (after slamming one's head against a wall while not looking in the right place, anything feels good).

Cheers,
Ancient Lady

Login to post a reply

Server time is: 2019-07-17 00:14:49
Your offset time is: 2019-07-17 00:14:49