Re: Does Fast Code units compile in D5 Standard ?
- From: "Rudy Velthuis [TeamB]" <velthuis@xxxxxxxxx>
- Date: Sun, 28 Aug 2005 13:41:47 +0200
At 12:41:46, 28.08.2005, Anders Isaksson wrote:
> Nicholas Sherlock wrote:
> >
> > PIntegerArray=^array[0..0] of integer; (Or possibly ^array of
> > integer).
>
> This one has the problem that you have to turn off range-checking when
> using it. By declaring
>
> PIntegerArray = ^array[0..SOME_UPPER_BOUND] of integer;
>
> you can leave range-checking on.
Agreed. I used to be a proponent of the [0..0] variety, but decided that
[0..SOMETHING_BIG] is usually safer to use, since you can leave
range-checking intact.
I think range and overflow checking should always be on, also in
production code.
SOMETHING_BIG can be anything suitable, up to
(MaxInt - 1) div SizeOf(Element)
I usually use $FFFF or $FFFFFF, which will do for most applications.
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de
"A narcissist is someone better looking than you are."
- Gore Vidal
.
- References:
- Does Fast Code units compile in D5 Standard ?
- From: bill
- Re: Does Fast Code units compile in D5 Standard ?
- From: Nicholas Sherlock
- Re: Does Fast Code units compile in D5 Standard ?
- From: Anders Isaksson
- Does Fast Code units compile in D5 Standard ?
- Prev by Date: Re: Does Fast Code units compile in D5 Standard ?
- Next by Date: Re: Does Fast Code units compile in D5 Standard ?
- Previous by thread: Re: Does Fast Code units compile in D5 Standard ?
- Next by thread: Re: Does Fast Code units compile in D5 Standard ?
- Index(es):
Relevant Pages
|