Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Kerblooey!
Tue, Jun 20 2017 8:24 AMPermanent Link

Matthew Jones

anFieldOrder : array of integer;

   SetLength(m_anFieldOrder, nOrderMax);
   for nLoop := 0 to Length(anFieldOrder) do
       anFieldOrder[nLoop] := nLoop;

Spot the deliberate mistake! This (at least with a member variable), will blow Chrome out of the water, and kill the debugger.

I was converting it from constants to use the Length, but it should be "Length(anFieldOrder) - 1" otherwise it keeps going until it blows up.

I do ponder whether the for loop should only evaluate the terminator once, but maybe it thinks it is a function so wants to allow changes.

Easy to spot [!] and fix of course.


Matthew Jones