Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Cannot allocate item. Out of id numbers (max 1000)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
hamid14




PostPosted: Fri Mar 05, 2010 5:40 pm   Post subject: Cannot allocate item. Out of id numbers (max 1000)

What is it you are trying to achieve?
Remove this error I get after a little while


What is the problem you are having?
When i run my turing code, it works fine for a few minutes, then it stops and an error comes up in turing, saying; "cannot allocate item. Out of id numbers (max 1000)


Describe what you have tried to solve this problem
Tried to use .gif images in different ways of codes, but was useless.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)


Turing:

var chars : array char of boolean
var frame, pic : int
frame := 1
pic := Pic.FileNew ("walk" + intstr (frame) + ".bmp")

loop
Input.KeyDown (chars)
if chars (' ') then
frame += 1
end if
if frame = 3 or not chars (' ') then
frame := 1
end if
end loop


Please specify what version of Turing you are using
4.1
Sponsor
Sponsor
Sponsor
sponsor
USEC_OFFICER




PostPosted: Fri Mar 05, 2010 5:48 pm   Post subject: RE:Cannot allocate item. Out of id numbers (max 1000)

Free the pictures you are using with Pic.Free (i:int). That should help the problem.
hamid14




PostPosted: Fri Mar 05, 2010 5:52 pm   Post subject: Re: Cannot allocate item. Out of id numbers (max 1000)

i was just going to try that, as i was thinking about it when coming from school. Thanks.
USEC_OFFICER




PostPosted: Fri Mar 05, 2010 5:53 pm   Post subject: RE:Cannot allocate item. Out of id numbers (max 1000)

Always glad to help.
hamid14




PostPosted: Fri Mar 05, 2010 6:23 pm   Post subject: Re: Cannot allocate item. Out of id numbers (max 1000)

im having new problems. Im not sure where i would put pic.free, the pics are of an character moving right and left. When the picture FRAME reaches 3, it goes back to 1 and repeats when pressing right arrow or left arrow. So, how would I know to pic.free and then get the pic back to display again?
USEC_OFFICER




PostPosted: Fri Mar 05, 2010 6:26 pm   Post subject: RE:Cannot allocate item. Out of id numbers (max 1000)

Use Pic.Free before you put a new frame to a varible. If the picture stays the same, don't pic.free it. I'm not too clear on the problem myself though.
Clayton




PostPosted: Sun Mar 07, 2010 2:06 am   Post subject: RE:Cannot allocate item. Out of id numbers (max 1000)

Seeing as your program seems to only allow 3 maximum frames, it's much better practice to just load all 3 frames ahead of time instead of reloading them each time the frame has changed.

Of course, without more context it's hard to tell exactly what's causing your problem, but right now I'm guessing the code you posted is nestled somewhere in a loop?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: