Re: I suppose the idea of classes and inheritance is



J French wrote:
On Fri, 13 Oct 2006 13:55:08 -0700, Jamie
<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






sorry to tell you, my R+ is normally on most of the time.
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

.



Relevant Pages

  • Help in French|Spanish|German translation.
    ... I am also an author of User-defined string functions. ... WORDTRANEX (cSearched, cArExpressionSought | cExpressionSough, ... each string of the array is searched ... If the parameter nArStartOccurrence is -1 or omitted, the replacement starts ...
    (microsoft.public.fox.helpwanted)
  • Re: embedded questions!!!
    ... >> which would have initialized a character array to a C string. ... I believe the array contents of 'unnamed' need not be ... memory such as flash for the location of 'unnamed's array of chars. ... Would a c compiler be allowed to "fold" these two constant arrays so ...
    (comp.arch.embedded)
  • Re: passing a string to a dll
    ... Joe, I really appreciate you taking the time to demonstrate this. ... sure how I would implement indexing it for random alphanumeric codes. ... I might handle the array. ... I actually have been wondering if I could use a second string ...
    (microsoft.public.vc.mfc)
  • Re: passing a string to a dll
    ... I might handle the array. ... I actually have been wondering if I could use a second string ... look at insertion cost, organization cost, and search cost. ...
    (microsoft.public.vc.mfc)
  • Re: Array Type Mismatch
    ... Dim resultAs String ... I am still somewhat confused as to why nothing is stored in the array. ... Public Function TextBoxGetLine(....arguments... ...
    (microsoft.public.access.formscoding)