Posted: Sat Nov 23, 2002 2:27 pm Post subject: Problem with turing
hi, i just have a slight problem. I wuz just makin a program and then a message sayin "Implementation restriction - Block nesting too deep." I got a bit angry afta it kept on popping up. How can i fix it??
Any help will be greatly appreciated. It would be good if a reponse can come today or latest 2moro. thx
Sponsor Sponsor
Tony
Posted: Sat Nov 23, 2002 3:40 pm Post subject: (No subject)
my guess is that there's a problem with your nesting of something... posting your code would be helpful.
Posted: Sat Nov 23, 2002 6:55 pm Post subject: (No subject)
i'm pretty sure it is not related to the loops, cuz i have like 9 of them. I may still have some problems to ask you, but i need my program to start working first, lol. Maybe i should send my file to u so that u can suggest what i should do. But it only works in turing 4.04b, and i dunno if u want the bmp's and the mp3.
Tony
Posted: Sat Nov 23, 2002 8:58 pm Post subject: (No subject)
don't have 4.04 nor will I get it...
If you've got many loops, make sure you indent properly. If you screw up with endings of loops, you might get in shit.
Posted: Sat Nov 23, 2002 11:07 pm Post subject: (No subject)
#####
Edited by Tony
Don't post stuff like that over here plz.
and I wouldn't want it ether... I got my reasons
krishon
Posted: Sun Nov 24, 2002 12:44 am Post subject: (No subject)
k, sry
Sponsor Sponsor
krishon
Posted: Mon Nov 25, 2002 10:07 pm Post subject: (No subject)
Another problem. It used to work before, but when i asked it to exit when ........., it wuz supposed to go to a menu. however, it went somewhere else. Wut can i do to fix it??
Tony
Posted: Mon Nov 25, 2002 10:11 pm Post subject: (No subject)
if you put exit when inside a netsted loop, it will exit only that single loop. That might cause a problem.
here's an alternative solution if thats the case:
code:
var flag:boolean := false
loop
loop
if ExitCondition then
flag := true
exit
end if
end loop
if flag = true then
exit
end if
end loop
basically you set up a flag boolean variable to keep track of when you need to exit
Posted: Mon Nov 25, 2002 10:17 pm Post subject: (No subject)
i get it, but i found out i added an extra loop,lol. But thanx for the advice. You've really helped me. I really appreciate it.
krishon
Posted: Mon Nov 25, 2002 10:28 pm Post subject: (No subject)
oh and one more thing. I saw the little message about the saving the variables. However, it wuz pretty confusing and it didn't really work. Could u help explain it??
Tony
Posted: Tue Nov 26, 2002 8:20 pm Post subject: (No subject)
what do you mean saving variables? Like assigning new value as in
variable := newValue or to external file? In that case check out a tutorial on I/O in tutorial section.
If its none of above, please specify your question.
Posted: Tue Nov 26, 2002 9:10 pm Post subject: (No subject)
actually, nm bout it, i got it to work
but i have another problem. I want to make a character in a game grow a level after it gets a certain number of experience points. How can i make it do that?? I've tried several things like dividing the number of experience points by a certain number and see if it was an integer. However, they did not work. Wut should i do??????????????
thx, kris
Dan
Posted: Tue Nov 26, 2002 10:31 pm Post subject: hummm
there are server things you coude do for this, the eisted whode to make a txt file with like 100 numse wich will repersent the number of ex points needed to lvl up for each level and have the prgame read the file. the progblem with thiss is that it can get repetive and you may whot to have your person be able to lvl up as much as they whont.
a nother sugestion is to use the flowing code, althoght this may not wrok right all the time it is able to some times cover a rela num to an int.
code:
var rnum : real := 5 div 2
var inum : int
var snum : string
snum := realstr (rnum,1)
inum := strint (snum,10)
put inum
this coude shode rownd the number up if itis not a wole number but becucale using it.
the onlyother way i can think of making an real to an int whode be using some completed code and the cheat fuction wich few poeopl know about, but becuse if you us it wrong you can mess over a lot of stuff i will not get in to that.
hope that helps.
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!