Re: I suppose the idea of classes and inheritance is



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.

come on now, you think i am that numb to perform this test with
out turning on range testing?, take my word for it, it was on in the
test.
Learning how the compiler really does things helps a lot.

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


keep digging.

you did notice that i used a variable and not a constant to
index the string?

It does not matter

as long as your in the boundaries of the memory mapped for that
string, things just keep on computing happily..! range testing would
in volve the compiler to include the String Length function call to know
where the actual end of the string really is.. the last time i looked,
range checking performed checks of known entities of know size at
compile time.
dynamically created objects like strings requires additional function
calls the be used in the code.
then of course, i am doing this in Win32 and not .Net or any other
make believe language.

Better check again, if you do not get an error, then you have a major
problem.


.



Relevant Pages

  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... Big-O notation isn't mathematics per se, it's computer science notation ... "length of the string". ... outrun something compiled and optimized by a good C compiler. ... > either general computing culture or culture outside computing. ...
    (comp.programming)
  • Re: [EGN] Hoisting Loop Invariants (Was: Re: [EGN] Numerical Accuracy)
    ... compiler out there somewhere that did as you claim. ... > the programmer has this knowledge, then the programmer should not use ... >> string in a loop, regardless of the blatant inefficiency of doing so. ...
    (comp.programming)
  • Re: Performance/efficiency question
    ... Discussion with Neal Gafter (author of the Sun compiler) reveals that the ... "Jim Sculley" wrote in message ... I know String buffers are better for dynamic Strings, ... >>> Concatenation of compile time constant String literals occurs at ...
    (comp.lang.java.programmer)
  • Re: PL/I string representations
    ... >> of the language, so it was interesting to me, hopefully it will be to ... I found a workable compiler for Fortran in 1971 (with a bug ... >> The specified length is the minimum, and each time a character ... >> string is assigned to E, the length is stored with it. ...
    (comp.programming)
  • Why C Is Not My Favourite Programming Language
    ... C has no string type. ... compiler take care of the rest. ... Why does any normal language ... the programmer fail. ...
    (comp.lang.c)