The recent pointer thread has sparked my memory about another pointer related issue that I've come upon. It's probably something I'm doing wrong, or a lack of understanding on my point, but here goes anyway...
I have a program that uses pointers in a number of different places for various things. Some are straight pointers while others are pointers to a record type. I'm trying to make one generic pointer "disposal" routine for the all (as opposed to having separate procedures for each different type of pointer). I thought it should be fairly easy, but I guess it's not (for me anyway :-)
I created the following Win32/GO32 procedure but the compiler doesn't seem to like it. Is there something obvious that I'm doing wrong here?
TIA...
Jim
Procedure ReleaseMemory (PointerName : pointer; Index : longint);
begin
if PointerName [Index] NIL then
begin
dispose (PointerName [Index]);
PointerName [Index] := NIL;
end;
end;