PDA

View Full Version : Weird memory address question



Paulius
18-09-2003, 07:49 PM
I have a class which contains an array and a procedure in which I get the address of that array. Everything works fine when calling that procedure normally, but when I call it from another procedure in the same class it gets a wrong address, always $4 :? . Maybe someone has any ideas what causes this.

Alimonster
18-09-2003, 08:42 PM
It could be that you've overrun a buffer somehow (e.g. too high values for FillChar, Move and the like), which would clobber nearby variables on the stack. It's hard to say without code -- could you post some please?

doggo18
18-09-2003, 09:34 PM
Must be silly me, but the number 4 reminds me of a few miscalled functions where I looked up the size of my variable, instead of the memory BEHIND it. Maybe you are doing something similar as well?

Paulius
18-09-2003, 10:14 PM
Whoops, when copying a unit from one project to another I didn?¢_Tt remove a declared object, then declared it again with a different name and was calling a working procedure of the correct object and the weird procedure from the old one which wasn?¢_Tt initialized :oops: , that?¢_Ts what happens when trying to code after 1a.m.