Wierd Problem

Blitz3D Forums/Blitz3D Programming/Wierd Problem

asdfasdf(Posted 2005) [#1]
I'm having trouble with some FreeEntity things. In blizdebugger it says "Entity Does not Exist." But it says in varible window, "mesh=127984081" Or what ever number.
Can anybody help?
Thanks


Ross C(Posted 2005) [#2]
The variable will still contain a number even if the entity is freed :o)

Check it out:

Graphics3D 800,600
SetBuffer BackBuffer()

mesh = CreateCube()


FreeEntity mesh

Print " freed mesh variable = "+mesh

While Not KeyHit(1)

Wend



asdfasdf(Posted 2005) [#3]
OK that would the answer. Thanks. I will fix it.


asdfasdf(Posted 2005) [#4]
OK that wourld the answer. Thanks. I will fix it.


jfk EO-11110(Posted 2005) [#5]
to prevent this you can use something like

mesh=myFreeEntity(mesh)

function myFreeEntity(m)
if m<>0 then freeentity m
return 0
end function


John Blackledge(Posted 2005) [#6]
Just get used to using
FreeEntity mesh : mesh = 0
every time.
(I _still_ forget too.)