Posts: 357
Threads: 118
Joined: Oct 2004
By commenting blocks I got an error down to one sub call. So I tried using comment blocks to find the error in the sub. I ended up commenting the entire sub out and it still doesn't run. If I take out the sub call it works. THERE IS NO CODE IN THE SUB! What could cause something like this? If you want to see code I'll post it but I don't think it will matter.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Of course it will matter.
Post the code.
Also, what version are you using? The current testing release is .17.
Posts: 357
Threads: 118
Joined: Oct 2004
Nevermind, it was a bad pointer. I thought code wouldn't matter because I had commented everything out except for this part.
sub loadskin (s as skin ptr)
loadskin1(s->skin1)
and I forgot to allocate s. Don't you just hate when you spend two days trying to figure out what's wrong then it smacks you in the head?
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Posts: 357
Threads: 118
Joined: Oct 2004
New question: If I have a sub that allocates memory and I don't want it to allocate something twice (create an orphan,) can I deallocate first?
sub foo (s as sometype ptr)
deallocate s
s = allocate (len(sometype));
end sub
if I send it a blank pointer will the deallocate mess something up? It's basically doing the same as:
dim s as sometype ptr
deallocate s
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Posts: 3,368
Threads: 195
Joined: Jan 2003
Cha0s, have you put me on ignore?
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 1,439
Threads: 15
Joined: Apr 2003
You shouldn't free null pointers. You should also specify "ByRef" explicitly if that's what you want; otherwise, it's not clear to the reader, and it will break when you switch to -lang fb.