Skip to content
Arthur van de Vondervoort edited this page Aug 20, 2024 · 3 revisions

Zero index access on 1-based List objects

List objects are 1-based, so raise a diagnostic on possible cases of trying to retrieve the zero (0) index.

Examples

procedure MyProcedure()
var
    myList: List of [Integer];
    i: Integer;
begin
    for i := 0 to myList.Count() do;
end;
procedure MyProcedure()
var
    myList: List of [Integer];
begin
    myList.Get(0);
end;

Read more:

Clone this wiki locally