mIRC Home    About    Download    Register    News    Help

Print Thread
#123389 23/06/05 12:06 AM
Joined: Jan 2003
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Jan 2003
Posts: 2
mIRC 6.14

I only glanced thru the most recent whatsnew.txt and these forums, so this may be already fixed or even not a bug..

Whle trying to write a script that could function as an alias or an identifier, I came across this little quirk/bug.. Here's the script..

alias state {
if (!$isid) { echo -ag *** Called as ALIAS: $1- | return }
else { return *** Called as $+(IDENTIFIER[,$prop,]smile $1- }
}

Typing "/state 123" results in "*** Called as ALIAS: 123" displayed as expected, and /echo -ag $state(123).abc results in "*** Called as IDENTIFIER[abc]: 123", again as expected. But /echo -ag $state().abc results in "*** Called as IDENTIFIER[]:"

It seems that if there are no arguements to the identifier, $prop returns $null regardless of any property specifier. And of course, dropping the ()'s (/echo -ag $state.abc) simply gives a no such identifier error.

#123390 23/06/05 12:36 AM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Indeed, mIRC does not accept empty parameter lists along with a property. Discussed here a while ago, but apparently not fixed since then - I just checked with 6.16, it has the same behavior.


Saturn, QuakeNet staff
#123391 23/06/05 01:14 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
You must add a space into the ( ) for it to work, (might be a command pharsing problem, I dont know)

//echo -ag $state( ).abc
*** Called as IDENTIFIER[abc]:

$0 = 1
$1 =
$len($1) = 0


* I also dont like how the $prop only evaluates to the trailing property after the last .
ie:
//echo -ag $state(123).abc.efg
*** Called as IDENTIFIER[efg]: 123


Link Copied to Clipboard