Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 04/12/20 in Posts

  1. Hi, I am looking at some older code and I see the author uses the following statement: for i:=0 to Pred(WhateverList.count) do instead of the usual one: for i:=0 to WhateverList.count - 1 do Does it make any real difference or it's just a personal preference? Thanks
  2. Mike Torrettinni

    Difference between Pred and -1

    I just saw noticed this (or recognized what it is) in sample code, for the first time! Pretty cool, can replace StringList.Count - 1, like High(Array) replaces Length(Array) - 1. @John Kouraklis let's see what else I can figure out a 1.5 years later than you 🙂
  3. Uwe Raabe

    Why does this code work when it shouldn't?

    Resizing an array to a smaller length doesn't invalidate the other elements. You should have range checking on to catch this error.
×