The problem has just disappeared, all of a sudden, even though the code is
now as it was.   I have to suspect user error.  :-)

I did note in my wanderings that the compiler sometimes has two loop
variables, one for its while and the other for your for.  Hardly makes for
efficient code.  How hard could it have been to add a for construct to the C
rubbish ?

I have another curly one that I have been meaning to post the code.



-----Original Message-----
From: Myles Penlington <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Monday, 31 July 2000 10:52
Subject: RE: [DUG]: D3 - Compiler bugs


>Rohit,
>Don't know if you fixed the problem but Delphi quite often does initialise
>local variables that are stored on stack, it does this on the initial entry
>point to the function by storing a DWORD 0 value on the stack (and
repeating
>as many times as required) in either a loop or multiple push instructions
>It has to do this for Strings, Interfaces etc
>
>Also if it does this it also automatically adds a try ..finally block to
the
>function/method call so that it can clear/release references etc to the
>variables.
>
>
>Myles.
>
>
>> -----Original Message-----
>> From: Rohit Gupta [SMTP:[EMAIL PROTECTED]]
>> Sent: Friday, July 21, 2000 8:47 PM
>> To: Multiple recipients of list delphi
>> Subject: Re: [DUG]:  D3 - Compiler bugs
>>
>> I havent had that happen.  However looking the cpu, I cant find anywhere
>> where the compiler initialises the loop variable.   Surely it is not
>> assuming that a local variable is 0 to begin with.
>>
>> -----Original Message-----
>> From: Myles Penlington <[EMAIL PROTECTED]>
>> To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
>> Date: Friday, 21 July 2000 15:54
>> Subject: RE: [DUG]: D3 - Compiler bugs
>>
>>
>> >Rohit,
>> >Beware that the Delphi debugger does NOT always show the correct value
of
>> a
>> >variable.
>> >I have occassionally had to use the CPU view to find out the real value
>> of
>> a
>> >variable.
>> >
>> >In some cases even though your loop is from 0 to N, Delphi will go from
N
>> to
>> >0 instead.
>> >
>> >
>> >
>> >> -----Original Message-----
>> >> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
>> >> Sent: Friday, July 21, 2000 10:20 AM
>> >> To: Multiple recipients of list delphi
>> >> Subject: [DUG]:  D3 - Compiler bugs
>> >>
>> >> We are tearing our hair out on multiple compiler bugs.  The latest
>> >> one is where the for loop variable has the wrong initial value....
>> >>
>> >> for I := 0 to object.items.count-1
>> >>
>> >> the initial value is 1, not 0.
>> >>
>> >> On one machine, if the type of I is changed from integer to smallint
>> >> or longint, then it works fine.  On another it does not no matter
>> >> what you do.
>> >>
>> >> Has anyone come across this before ?  I seem to recall there was
>> >> a reported bug in for loop because of its translation to C construct.
>> >>
>> >>
>> >>
>> >> Rohit
>> >>
>> >> ======================================================================
>> >> CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New Zealand
>> >> PH    (649) 489-2280
>> >> FX    (649) 489-2290
>> >> email [EMAIL PROTECTED]  or  [EMAIL PROTECTED]
>> >> ======================================================================
>> >>
>> >>
>> -------------------------------------------------------------------------
>> -
>> >> -
>> >>     New Zealand Delphi Users group - Delphi List -
[EMAIL PROTECTED]
>> >>                   Website: http://www.delphi.org.nz
>>
>-------------------------------------------------------------------------
>> --
>> >    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>> >                  Website: http://www.delphi.org.nz
>> >
>>
>> -------------------------------------------------------------------------
-
>> -
>>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>>                   Website: http://www.delphi.org.nz
>---------------------------------------------------------------------------
>    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                  Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to