![]() Writeln('intArray2:' + RangeDisplay(intArray2)) Writeln('intArray1:' + RangeDisplay(intArray1)) Writeln('emptyArray:' + RangeDisplay(emptyArray)) Result := result + ', ' + snRange.ToString įunction RangeDisplay(const intList: TList) : string overload Ĭonstructor TRange.Create(const _start, _stop: integer) If (intArray = Succ(snRange.Stop)) OR (intArray = snRange.Stop) then SnRange := TRange.Create(intArray, intArray) įor i := 1 + Low(intArray) to High(intArray) do System.SysUtils,, Ĭonstructor Create(const _start, _stop : integer) įunction RangeDisplay(intArray: TArray) : string overload Here’s an algorithm (in a console app code) that does the above If you would want to display the above years in a user friendly manner as a set of ranges, you could go for:ġ995 - 1999, 2001 - 2003, 2005 - 2007, 2009 - 2018, 2020 - 2022 Say you have an array of integer values, for example, pages of a document or years when something happened, like years when new Delphi version was released: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |