mIRC Homepage
Posted By: noMen /set -n doesn't work? - 25/08/07 08:09 PM
I use mirc 6.17 and with this version I have the following problem:

Quote:

on *:input:*: {
set -n %origtext $1-
..etcetera..


I thought the -n switch would prevent $1- from being evaluated, but when I enter 8 - 1 the answer 7 is placed into %origtext. When I enter 8-1 indeed 8-1 is placed into %origtext.

What is wrong?
Posted By: genius_at_work Re: /set -n doesn't work? - 25/08/07 08:55 PM
Does this happen on the latest mIRC (version 6.3) ?

-genius_at_work
Posted By: Wims Re: /set -n doesn't work? - 25/08/07 09:45 PM
I'm unable to reproduce this bug on mirc 6.3, i use this code :
Code:
on *:input:*: {
  set -sn %origtext $1-
}


Posted By: noMen Re: /set -n doesn't work? - 25/08/07 09:52 PM
Ow ... set -n DOES work, BUT I call another alias where I store the entered text in a variable:

Quote:

on *:input:*: {
set -n %origtext $1-
saytext
halt
}

alias -l saytext {
var %temp = %origtext
.say %temp
}


I simplified the code for good understanding.

var -n %temp = %origtext is not valid
Posted By: Wims Re: /set -n doesn't work? - 25/08/07 10:16 PM
I'm not sure this is a bug, you should use $(,0)
Posted By: qwerty Re: /set -n doesn't work? - 25/08/07 10:22 PM
FYI, you can declare a local var with /var %temp and then set it with /set -n %temp %origtext (or use the undocumented -l switch, that makes /set create a local var: /set -ln %temp %origtext)
Posted By: noMen Re: /set -n doesn't work? - 25/08/07 10:25 PM
Can you give an example, because var %temp = $(%origtext, 0) results in saying "%origtext"
Posted By: deegee Re: /set -n doesn't work? - 26/08/07 03:11 AM
Originally Posted By: noMen
Can you give an example, because var %temp = $(%origtext, 0) results in saying "%origtext"

//set -un %original 8 - 1 | var %a | set -n %a %original | echo -ag %a
Posted By: noMen Re: /set -n doesn't work? - 26/08/07 06:52 AM
Thank you both qwerty and deegee smile
Posted By: noMen Re: /set -n doesn't work? - 17/09/07 12:01 AM
I am confused again ...
I try to set a variable to "type //echo -a $mircdir to find your mircdirectory". But using set -n %text type //echo -a $mircdir still evaluates $mircdir. According to the helpfile the -n switch should prevent that. I have to use $($mircdir, 0) with or without -n to prevent it from being evaluated. Why is the -n switch not working?
Posted By: deegee Re: /set -n doesn't work? - 17/09/07 12:12 AM
The -n switch prevents calculations, not evaluations wink

You can use ! to prevent the evaluation

  • set %text type //echo -a $!mircdir to find your mircdirectory
Posted By: noMen Re: /set -n doesn't work? - 17/09/07 12:17 AM
aaaaaargh I always forget that. I'll save this link smile
© mIRC Discussion Forums