Re: I suppose the idea of classes and inheritance is
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Sat, 14 Oct 2006 12:34:27 -0700
J French wrote:
On Fri, 13 Oct 2006 13:55:08 -0700, Jamiesorry to tell you, my R+ is normally on most of the time.
<jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx> wrote:
<snip>
You have not got Range Checking turned on
- either turn it on via Project/Options or use {$R+} - then try running the code
IMO Range Checking should always be on by default, and only turned off
under very defined circumstances.
Jamie, I cut and pasted your code.
I then ran it - no Error
I then added {$R+} and it threw an error
Possibly there is something wrong with your Delphi setup, or maybe
your version behaves differently - I'm using D4P
i only turn it off on finaliation of the app. but if it makes
you any happier, i included the {$R+} with no difference in
results.
my compiler is just happy with it.
now if you were to do that using a short string or a
array char it would then generate a range error.
and by all rights, the original code should not fault anyways
since the compiler automaticly includes a #0 at the end of the
string which makes it part of the string. this is common practice
with many char array string functions, i just don't see why there
is such a problem here. ?
if you look at my code i pasted, i did not index past that point
even though the Length function would report 4, there is still a
fith charactor there if this is to be a dynamic string (RTL).
and again, try that on a short or charactor array type string and yes,
it will detect a range problem if you index out side the known boundrie's of object at compile time.
i am using D3 and D7.
--
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
.
- Follow-Ups:
- Re: I suppose the idea of classes and inheritance is
- From: Rob Kennedy
- Re: I suppose the idea of classes and inheritance is
- References:
- I suppose the idea of classes and inheritance is
- From: Genome
- Re: I suppose the idea of classes and inheritance is
- From: Maarten Wiltink
- Re: I suppose the idea of classes and inheritance is
- From: Genome
- Re: I suppose the idea of classes and inheritance is
- From: Jamie
- Re: I suppose the idea of classes and inheritance is
- From: Maarten Wiltink
- Re: I suppose the idea of classes and inheritance is
- From: Jamie
- Re: I suppose the idea of classes and inheritance is
- From: J French
- Re: I suppose the idea of classes and inheritance is
- From: Jamie
- Re: I suppose the idea of classes and inheritance is
- From: J French
- Re: I suppose the idea of classes and inheritance is
- From: Jamie
- Re: I suppose the idea of classes and inheritance is
- From: J French
- I suppose the idea of classes and inheritance is
- Prev by Date: Re: I suppose the idea of classes and inheritance is
- Next by Date: Re: I suppose the idea of classes and inheritance is
- Previous by thread: Re: I suppose the idea of classes and inheritance is
- Next by thread: Re: I suppose the idea of classes and inheritance is
- Index(es):
Relevant Pages
|