Posted: Tue Dec 10, 2002 9:49 pm Post subject: dam goto
i dont know if you saw my other post about goto fuctions but here is a sumery
Quote:
FOR THE LOVE OF GOD DO NOT USE GOTO IN YOUR PORGAMES!!!!!!!!!
this uless you know what you are doing or are using it for error checking.
not much good can come from goto.
use a loop of some kind to make your progame repeat or use fuctions/prosgeres
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Tony
Posted: Tue Dec 10, 2002 9:55 pm Post subject: (No subject)
dan, we went over this before... Anything can be dangerous if you don't know what you're doing...
loops for example. If you "forget" to put a proper exit statment, you'll get into an infinate loop. Just like you can GoTo wrong spot... Same chances actually.
Posted: Tue Dec 10, 2002 10:02 pm Post subject: kill the goto
i know but i relay relay relay have isuses ageasted goto, it is relay just my opiean. but i also think that it makes you look like a poor porgamer if you uses it too much in a progame, it just is not neacery.
well w/e. i just hope it is not in turing
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
azndragon
Posted: Wed Dec 11, 2002 3:53 pm Post subject: (No subject)
Well, I'm only using it because it takes quite a while to test my program, and it's kinda annoying going through the same processes over and over again
Tony
Posted: Wed Dec 11, 2002 4:59 pm Post subject: (No subject)
why not just comment it out then?
highlight what you don't want, then go to Edit -> Comment (i think)
Posted: Wed Dec 11, 2002 7:52 pm Post subject: (No subject)
Okay, another problem, when I try to retrieve the data using the get statement, most of it loads, except one is saying "Invalid integer input". I checked it out, and it turns out that the value that it's trying to load is a 0. Will that cause any problems with my loading, or is there something wrong with my code?
EDIT: Okay, it's not something wrong with my code, because I cut out the code that loads the variable with 0's stored as them, and it works fine. Now all I need to know is how to get Turing to load all the variables, even if they are zeros.
Also, one more thing, I want the user to enter a normal number in certain parts of the game. Is there a code or something that converts all decimal numbers to integers so that the program doesn't crash when a real number is inputted where an integer should be?
Sponsor Sponsor
Tony
Posted: Wed Dec 11, 2002 8:18 pm Post subject: (No subject)
is it 0(Zero) or NULL ? cuz they are different.
Though I donno, maybe its the way you read it or something. 0 is an integer
Yes, there're 3 ways you can change real to integer.
round()
ceil()
floor()
all 3 round the real value and return integer. Ceil always rounds up and floor always rounds down.