<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hello,</DIV>
<DIV> </DIV>
<DIV>(Delphi limitation, but probably applies to free pascal as
well):<BR><BR>Take following examples:<BR><BR>Tvalue =
smallint;<BR><BR>or<BR>Tvalue = word<BR><BR>or<BR><BR>Tvalue = 0..5000;<BR><BR>^
All of these examples are quite bad in the following way:<BR><BR>They become
very static, which makes it pretty much impossible to change <BR>their range at
runtime.<BR><BR>These types are pretty much a left over from the days of turbo
pascal, and <BR>is a reason why people switched to C, where arrays where dynamic
in <BR>range/size.<BR><BR>The succ/pred functions are also pretty useless and
dangerous.<BR><BR>If a pascal type/array using these static types needs to
change to a dynamic <BR>type, and these succ/pred functions will lead to out of
range <BR>problems/situations.<BR><BR>My recommendation for the Delphi language
is to do away with these static <BR>types and instead change them to dynamic
types, just like arrays where <BR>expanded with dynamic types.<BR><BR>Ofcourse
it's nice and perhaps even required to keep these static types for <BR>backward
compatibility but it would also be nice if these types can be <BR>expanded with
a dynamic type, so it can be safely used with dynamic arrays <BR>which can be
any size/range.<BR><BR>How this should be solved syntax-ically I don't know but
I will give it a <BR>try below, perhaps:<BR><BR>var<BR> MinValue :
integer;<BR> MaxValue : integer;<BR><BR>Tvalue =
MinValue...MaxValue;<BR><BR>then this type could also be used as
follows:<BR><BR>var<BR> DynamicArrayOfValues : array[Tvalue] of
integer;<BR><BR>The user could then even fall back to old style of
programming:<BR><BR>MinValue := 5000;<BR>MaxValue :=
10000;<BR><BR>DynamicArrayOfValues.Allocate;<BR><BR>DynamicArrayOfValues [5000]
:= 1000;<BR>DynamicArrayOfValues [6000] := 2000;<BR>^ array starts at 5000 kinda
cool.<BR>Etc...<BR><BR>Finally the pred/succ could be safely used as
well:<BR><BR>vValue := 5000;<BR><BR>DynamicArrayOfValues[Pred(vValue)] := etc;
// would wrap back to 6000<BR>DynamicArrayOfValues[Succ(vValue)] := etc; //
would wrap back to 5000<BR><BR>Just some idea's for you to
explore...<BR><BR>Bye,<BR> Skybuck. <BR></DIV></DIV></DIV></BODY></HTML>