Hello everyone, I can not understand what's the matter, why it displays an error.
There is a cyclic dynamic sheet. element [value, reference]
The latter indicates the beginning of the cycle, not nil.
I am trying to remove, but throws out the "invalid Pointer 204". Sat, watched - removal is executed for some reason 2 times, then throws out an error.
Functions are commented, I think it will be clear.
Here is the source .
Here is the delete function itself:
... {DELETE ALL ELEMENTS OF LIST} procedure DeleteList; var p: TPoint; begin repeat begin if BeginList^.Next = BeginList then begin dispose(BeginList); BeginList := nil; break; end else begin p := BeginList; BeginList := BeginList^.Next; dispose(p); end; end; until BeginList = nil end; ...