mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2004
Posts: 5
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2004
Posts: 5
In an attempt to be LFN Compliant, I've found the following bug.

When using $script() to return whether a script is loaded or not, any argument with with "'s around it will not return correctly.

Example:

$script(c:\script\file.mrc) will return: c:\script\file.mrc
$script("c:\script\file.mrc") will return: $NULL

Just letting ya know,

[email]ice-man@efnet[/email]
shocked


Matt Douglas
[email]ice-man@efnet[/email]
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
That is actually correct, and how it is suppose to work.. $script(N).

Syntax; $script(1,2,3,ect).
Syntax; $script(drive:\dir\filename).

It returns the full pathname if is loaded, and NULL if it doesnt. Since the filename doesnt actually have "s in it, its returning NULL as it should, because mIRC doesnt "store" the "s just the filename.

Eamonn.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
It looks like a bug to me:

//echo -a $script($+(",$script(1),")) :: $file($+(",$script(1),")) :: $shortfn($+(",$script(1),"))

Why do $file() and $shortfn() not complain about quotes but $script() does?


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
My guess would be because, $file() and $shortfn() actually lookup the filename from your directory, and do whatever it does with them.

$script() however does not, it looks for the information, seemingly from memory, and is treating the "s as part of the actual filename.

And, $script() does not require "s because its not searching your drive, its looking in memory.

Eamonn.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Double quotes have nothing to do with reading from a hard drive as opposed to main memory, they're simply a common syntax used to delimit filenames in a space-delimited environment (ie. command prompt, mIRC scripting commands).


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
$file, $shortfn, $read, etc don't require "s either.


New username: hixxy
Joined: Sep 2004
Posts: 5
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2004
Posts: 5
I was just posting what I saw, I asked a few people if they thought it would be a bug and they all agreed.

the reason that it actually does make a difference in some instances is in the instance of this:

alias modloaded { return $iif($script($1-),$true,$false) }
This cycles through all the .MOD files in a particular and checks if they are loaded, which is done so by passing quotes to it to be LFN compliant)

the workaround of course is simple, which is:
alias modloaded.fix { return $iif($script($remove($1-,",)),$true,$false) }

Who knows? maybe its a bug, maybe its not, I'm just making ppl aware.


Matt Douglas
[email]ice-man@efnet[/email]

Link Copied to Clipboard