mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2003
Posts: 27
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
Not sure if this is a bug or if i need to code this differently.

In my script i have this line:
Code:
    if (*} iswm %i.data) {


Despite the fact that $chr(125) is in %i.data, it fails to trigger.
%i.data = sometext}}

However, if i use this is a command on the command-line, it DOES trigger.
Code:
 /if (*} iswm %i.data) { .echo -s YES } 


This neatly displays YES in the status window.

Any suggestions?

Joined: Nov 2003
Posts: 27
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
I think i figured out the problem. There seems to be an invisible character at the end of the variable.
I assume once i figure out what it is, i may be able to resolve the problem.

Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
} is primarily used as a close for code, so if you're intending to detect it, it would probably be best to actually use $chr(125)

I may be wrong, so if anyone else knows for certain, then this is the only idea have.

Code:
 if ($chr(125) iswm %i.data) {
.echo -s YES
}

Joined: Nov 2003
Posts: 27
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
That didn't work either, neither did $eval(* $+ $chr(125),1).
The issue really was the invisible chars. In this specific case $chr(10) and $chr(13).

I didn't realize it, until i wrote it all to an .ini file and i saw empty lines, where there shouldn't have been.

After checking the $len and the visible data, i saw there was a mismatch. Then after using $asc($right(%i.data,1)), i was able to remove the unwanted characters.


Link Copied to Clipboard