Logo

Programming-Idioms

History of Idiom 44 > diff from v24 to v25

Edit summary for version 25 by :
[Pascal] Fixed param order. Removed useless lines. +DocURL.

Version 24

2016-02-07, 17:32:15

Version 25

2016-02-07, 21:07:27

Idiom #44 Insert element in list

Insert element x at position i in list s. Further elements must be shifted to the right.

Idiom #44 Insert element in list

Insert element x at position i in list s. Further elements must be shifted to the right.

Imports
Uses Classes;
Imports
Uses Classes;
Code
if i < s.Count then
  s.Insert(x, i)
else
  s.Add(s)
end;
Code
s.Insert(i, x)
Comments bubble
s is a TList.
Comments bubble
s is a TList.
Doc URL
http://www.freepascal.org/docs-html/rtl/classes/tlist.insert.html