Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Borland Delphi > Re: Oh never mi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 3717 of 3888
Post > Topic >>

Re: Oh never mind, it seems to be working anyway.

by "Skybuck Flying" <BloodyShame@[EMAIL PROTECTED] > Apr 29, 2008 at 11:04 PM

Neh,

I see what the problem was,

I was just dreaming.

Some other code look the same but did a shr 3.

Like so:

Bla := (vComponentsRemaining * 10 + vComponentsCompressed * 2) shr 3;

Then I pointed mouse cursor at Bla.

And the debugger hint showed something.

I forgot it was already divided by 8 ! HA !

So when I tried to figure out if it was working I was again dividing it by
8 
in my head/calculator.

Which was ofcourse wrong. Hehe ! Funny debugging mistake ! ;) :)

It seemed a bit unlikely that it was always precisely div 8 and no 
remainder, but apperently so far no remainders hihihi.

Bye,
  Skybuck.

"Skybuck Flying" <BloodyShame@[EMAIL PROTECTED]
> wrote in message 
news:8b170$48178a39$541983fa$5512@[EMAIL PROTECTED]
> Oh it didn't make any sense anyway since the calculation couldn't
possibly 
> be interpreted as a boolean value so that tipped me off.
>
> Something else must be happening.
>
> Euhm maybe I am just dreaming.
>
> Ok back to inspection.
>
> (This example works just fine)
>
> program Project1;
>
> {$APPTYPE CONSOLE}
>
> uses
>  SysUtils;
>
> var
> vComponentsRemaining : longword;
> vComponentsCompressed : longword;
> begin
>  try
> vComponentsRemaining := 10;
> vComponentsCompressed := 11;
>
> if (vComponentsRemaining * 10 + vComponentsCompressed * 2) and 7 > 0
then 
> // mod 8
> begin
>  writeln('add one more byte.');
> end;
>
> if (vComponentsRemaining * 10 + vComponentsCompressed * 2) mod 8 > 0
then 
> // mod 8
> begin
>  writeln('add one more byte.');
> end;
>
> { TODO -oUser -cConsole Main : Insert code here }
>  except
> on E:Exception do
>   Writeln(E.Classname, ': ', E.Message);
>  end;
>  readln;
> end.
>
> Bye,
>  Skybuck.
>
 




 3 Posts in Topic:
Ouch, funny, nasty bug: if Calculation and 7 > 0 then
"Skybuck Flying"  2008-04-29 22:50:34 
Oh never mind, it seems to be working anyway.
"Skybuck Flying"  2008-04-29 22:57:00 
Re: Oh never mind, it seems to be working anyway.
"Skybuck Flying"  2008-04-29 23:04:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Aug 28 5:37:41 CDT 2008.