View Poll Results: How many time beep() will be preformed?

Voters
21. You may not vote on this poll
  • 0 times.

    18 85.71%
  • 1 time.

    1 4.76%
  • It really all depends on the weather outside.

    2 9.52%
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: For loops

  1. #11

    For loops

    I've found that there are a lot of bugs in my SP0 version of Delphi2006..

    Things like the intellisense gadget doesnt know about functions I'm using from another unit that's properly declared. It refuses to see the declared unit,
    and what made me think of this thread, sometimes the program would fail to compile using the normal F9, but when I did a full rebuild it worked 100%.
    My site: DelphiTuts.com (coming soon)...

    Download Font Studio 4.21 here.

  2. #12

    For loops

    I wrote this test code, its the same style of the problematic code but this loop works as expected:
    [pascal]function getEVal(var r: integer): boolean;
    begin
    r:= random(2);
    result:= True;
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    var
    I, E: Integer;
    begin
    getEVal(E);
    caption:= inttostr(E-1);
    for I := 0 to E-1 do
    caption:= caption + ' beep';
    end;[/pascal]

    This is the problematic code: (you can see the IF fixup)
    [pascal] SI_GetNumDevices(DeviceCount);
    // look for valid device
    if DeviceCount > 0 then
    for I:= 0 to DeviceCount-1 do[/pascal]
    [size=9px]BEGIN GEEK CODE BLOCK
    <br />d s-- : a24 GB GCS GTW GE C++ P L+ W++ N+ K- w++++ M- PS+ PE+ Y- t+ 5+++ X+ R*
    <br />tv b+ DI++ D+ e++ h+ G-
    <br />END GEEK CODE BLOCK[/size]
    <br />Create your own GeekCode block at: <a href="">...</a>

  3. #13

    For loops

    :shock: OMG I'm soo stupid.. its soo humiliating to write this post...

    After the last post I rechecked the "problematic" code, and "I" was defined there as cardinal!!! ops: I normally use integers but in this case I used cardinal as that what was used in the imported dll. :?

    Sorry guys...
    [size=9px]BEGIN GEEK CODE BLOCK
    <br />d s-- : a24 GB GCS GTW GE C++ P L+ W++ N+ K- w++++ M- PS+ PE+ Y- t+ 5+++ X+ R*
    <br />tv b+ DI++ D+ e++ h+ G-
    <br />END GEEK CODE BLOCK[/size]
    <br />Create your own GeekCode block at: <a href="">...</a>

  4. #14

    For loops

    :lol: no problem!
    sometimes happen also to me something like a stupid error that block you for days...and you are near to destroy your pc after find the bug
    Will: &quot;Before you learn how to cook a fish you must first learn how to catch a fish.&quot; coolest

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •