Re: Something that really annoys me in Delphi ...
From: Rob Kennedy (.)
Date: 01/07/04
- Next message: Bruce Roberts: "Re: Something that really annoys me in Delphi ..."
- Previous message: Duncan Murdoch: "Re: Something that really annoys me in Delphi ..."
- In reply to: Maarten Wiltink: "Re: Something that really annoys me in Delphi ..."
- Next in thread: Bruce Roberts: "Re: Something that really annoys me in Delphi ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 07 Jan 2004 16:49:28 -0600
Maarten Wiltink wrote:
> ... enforcing the invalidity of calling Succ(High(.)) requires a
> range check, and due to technical limitations this means having range
> checking enabled globally.
Well, you could just enable range checking locally. Something like this:
{$R+}
NextVal := Succ(CurrentVal);
{$R-}
There are known bugs regarding range checking and overflow checking with
the compiler-magic functions like Inc and Succ, though. As I recall,
they don't generate errors quite as consistently as conventional
arithmetic operations do.
-- Rob
- Next message: Bruce Roberts: "Re: Something that really annoys me in Delphi ..."
- Previous message: Duncan Murdoch: "Re: Something that really annoys me in Delphi ..."
- In reply to: Maarten Wiltink: "Re: Something that really annoys me in Delphi ..."
- Next in thread: Bruce Roberts: "Re: Something that really annoys me in Delphi ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]