mIRC Homepage
Posted By: ChRoNoN Strange /echo Error - 12/07/04 02:02 AM
I doing a random name generator and I found something wierd...

//echo $calc(2 / 1)

I believe this command should show 2 on current window, but it does not. If you try:

//echo $calc(1 / 2)

it's shows, why? It happens to //echo $calc($log(10) / $log(10)) also
Posted By: Collective Re: Strange /echo Error - 12/07/04 02:06 AM
Because in the first one mIRC evaluates the $calc(2 / 1) to 2. Since the first parameter of /echo is taken to be a colour if it's an integer it says insufficient parameters as you have not specified any text to echo.

In the second one the first parameter given is not an integer, and therefore used as the text to echo.
Posted By: CNO Re: Strange /echo Error - 12/07/04 02:10 AM
hi,

because your first argument is a number mIRC is trying to handle it as color code for the following line and stops because there's no text to output.

try //echo -a $calc( 2 / 1 ) instead.

EDIT:
collective was faster wink
Posted By: ChRoNoN Re: Strange /echo Error - 12/07/04 02:23 AM
I see, thanks...
Posted By: ChRoNoN Re: Strange /echo Error - 12/07/04 02:26 AM
It seems we've nothing better to do grin
© mIRC Discussion Forums