Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16

Thread: Java-style for loop

  1. #11
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,820

    Default

    Yeah. Revision 17497 allows this:

    Code:
    int a = 2;
    {
        int a = 1;
        print( "inner a = " + a );
    }
    print( "outer a = " + a );
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  2. #12
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,370

    Default

    Unknown variable 'j' ()
    Originally Posted by heeheehee View Post
    Haha! Forgot to "verify post".
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******* (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer******** (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  3. #13
    Developer
    Join Date
    Aug 2009
    Posts
    2,596

    Default

    (not to mention the part where you didn't have an iteration statement, so that'd loop indefinitely)

  4. #14

    Default

    (not to mention the part where you didn't have an iteration statement, so that'd loop indefinitely)
    Originally Posted by heeheehee View Post
    I assumed that was the point.

  5. #15
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,820

    Default

    Me too. Infinite gratitude.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  6. #16
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,155

    Default

    Let's fix the code...

    for (int i=1, int j; j < 12; i++) {
    print("Thank you "+i+" times!");
    }
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


Posting Permissions

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