mIRC Homepage
Posted By: Zelda4ever32 timer/inc -c and goto/while - 29/07/04 06:18 PM
Hey everyone,

I tried using the following code:
Code:
alias ttst {
  var %y 0 
  inc -c %y 1
  :s
  if (%y < 9) goto s
  echo -a done!
}
  

It SHOULD delay the script (see /return suggestion), but it doesnt. Possibly a bug, or a feature just not implemented. Either way, I'd like to see it work. :^)

-Zelda4ever
aka "The Big 'Z'"
Posted By: Darwin_Koala Re: timer/inc -c and goto/while - 30/07/04 05:41 AM
The problem is in your code to start off with, you need to move the label (s) to before the increment. The code as you have it makes %y = 1, then checks to see if it >9 and then end!

code:
--------------------------------------------------------------------------------
alias ttst {
var %y 0
:s
inc -c %y 1
if (%y < 9) goto s
echo -a done!
}


However, this pause may also delay any other activity in the background. If you search the boards you will see some code that I posted that gives a delay of "n" seconds, which is similar in concept to what you have posted. There are some additional technical comments from others as to why that was or was not a good idea!

Cheers,
DK

(Please excuse typo's as English is my first language!)
Posted By: Nobodi Re: timer/inc -c and goto/while - 30/07/04 09:20 AM
Did you even bother to look what the -c switch does.

The -c switch increases %var once per second.
Posted By: Zelda4ever32 Re: timer/inc -c and goto/while - 31/07/04 12:22 AM
Hey,

Of course I checked! It was an attempt at making a delay (if you clicked the link you shoulda known wink ) It should just keep looping until the inc -c %y goes to 9. Lets just say it looks good on paper, but not processed.

-Zelda4ever
ala "The Big 'Z'"
Posted By: Darwin_Koala Re: timer/inc -c and goto/while - 31/07/04 11:20 PM
Guilty as charged! There goes that old programmers logic again!

(/me thwaps himself with a used trout reading a 60lb Unix manual)

Cheers,

DK
© mIRC Discussion Forums