[fpc-pascal] Any chance to add the TStringBuilder to FCL?

Jürgen Hestermann juergen.hestermann at gmx.de
Mon Apr 18 19:01:22 CEST 2016


Am 2016-04-18 um 09:53 schrieb Marco van de Voort:
> Limits like in
>
> for i:=0 to someexpression.count-1
>
> are evaluated as expression before using the result to for. If count=0 this
> would become for i:=0 to $FFFFFFFF, so you need to guard this with a if
> count>0 then.
>

Well, for 1-based arrays it would be

for i := 1 to someexpression.count

(without the annyoing -1).
In general I can make sure that somexpression.count is zero or larger
when I use it to determine an index for my array.
The same would be

for i := low(array) to high(array)

which is very common and where I would not need to use an unsigned integer.







More information about the fpc-pascal mailing list