mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
He ment goto break.


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Oct 2006
Posts: 48
G
Ghozer Offline OP
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Oct 2006
Posts: 48
Quote:
What are you talking about? There is no /break or /halt command in the code.


yeah, i was meaning the goto break, i was speaking literal re: yours and previous 'hack' versions and ways round it..

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Better would be this

Code:
alias moo { 
  var %moo = $1
  var %in = $true | while (%in) { var %in = $false
    goto %moo {
      :cow 
      echo -a moo cow 
      break 
 
      :dog 
      echo -a moo dog 
      break
 
      :d&c
      echo -a moo duck
 
       :cat 
      echo -a moo cat 
      break
 
      :%moo 
      echo -a moo mouse 
      break
    }
  }
  echo -a code beyond the case
}


thats pretty read able as well, and we even get to use the real /BREAK command

[edit]
I just thought as well it leads to another interesting option, the ability to alter %moo and recall the case select if you so desired, by use of the /CONTINUE comand, forcing it to return to the top of the while loop.

Last edited by DaveC; 16/10/06 11:13 PM.
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Hey cool nicely "abused" mate never thought of that before. Its still not indented correctly but still the half of something is better then a whole lot of nothing smile

if implemented i would also like to see the case statement using () as well as suppose to JS/PHP since we dont use quoted strings
Code:
switch (%var) { 
  case (dog) { 
    echo -a what you know! its a dog!
    break
  }
  default { 
    echo -a what you know! its not a dog :(
  }
}

Though default doesn't really need bracketing there :tongue:


$maybe
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
It would be much more readable without the extra pair of braces and the additional indentation of the while block, but it's an interesting idea nonetheless.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Page 2 of 2 1 2

Link Copied to Clipboard