mIRC Home    About    Download    Register    News    Help

Print Thread
#90133 12/07/04 02:02 AM
Joined: Dec 2002
Posts: 11
C
ChRoNoN Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Dec 2002
Posts: 11
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

Last edited by ChRoNoN; 12/07/04 02:21 AM.
#90134 12/07/04 02:06 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

#90135 12/07/04 02:10 AM
Joined: Apr 2004
Posts: 8
C
CNO Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
C
Joined: Apr 2004
Posts: 8
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

Last edited by CNO; 12/07/04 02:12 AM.
#90136 12/07/04 02:23 AM
Joined: Dec 2002
Posts: 11
C
ChRoNoN Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Dec 2002
Posts: 11
I see, thanks...

#90137 12/07/04 02:26 AM
Joined: Dec 2002
Posts: 11
C
ChRoNoN Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Dec 2002
Posts: 11
It seems we've nothing better to do grin


Link Copied to Clipboard