mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
$isalias(sfile) is $false. #180635 12/07/07 03:16 PM
Joined: Jan 2003
Posts: 73
K
kupotek Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jan 2003
Posts: 73
I don't get it. Why would $isalias(sfile) echo false?
When i try to $sfile an executable it returns the folder,
I'm completely at a loss here.

XP PRO SP2
mIRC 6.21

Re: $isalias(sfile) is $false. [Re: kupotek] #180638 12/07/07 03:29 PM
Joined: Dec 2002
Posts: 2,019
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,019
Quote:
I don't get it. Why would $isalias(sfile) echo false?

Because $sfile is not an alias, but a built-in identifier.

Quote:
When i try to $sfile an executable it returns the folder,

It works correctly here, make sure you have the trailing \ in the dir field.

Re: $isalias(sfile) is $false. [Re: RoCk] #180648 12/07/07 03:56 PM
Joined: Dec 2002
Posts: 17
V
voks Offline
Pikka bird
Offline
Pikka bird
V
Joined: Dec 2002
Posts: 17
Code:
//echo -a $sfile(*.*,$+(Choose the executable file of your media player))

This returns
Code:
C:\Program Files\Winamp\
for winamp.exe for example. (Not for me, but for kupotek.)


using mirc 6.35 on WinXP Home SP3 and Windows 7
Re: $isalias(sfile) is $false. [Re: voks] #180649 12/07/07 04:01 PM
Joined: Dec 2002
Posts: 2,019
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,019
I don't know why it would do that for him.

//echo -a $sfile(*.*,$+(Choose the executable file of your media player)) <-- this is me

C:\Program Files\Winamp\winamp.exe <-- this is me

How about you?

Re: $isalias(sfile) is $false. [Re: RoCk] #180651 12/07/07 04:08 PM
Joined: Dec 2002
Posts: 17
V
voks Offline
Pikka bird
Offline
Pikka bird
V
Joined: Dec 2002
Posts: 17
It's working great here, too. I use this in my mp3ad+ script, but it's not working for kupotek. So he told me about this problem.
$isalias(sfile) is $false, so the alias is not overwritten by some other script or something. So it has to be a mIRC bug/problem, right?!

Last edited by voks; 12/07/07 04:08 PM.

using mirc 6.35 on WinXP Home SP3 and Windows 7
Re: $isalias(sfile) is $false. [Re: voks] #180652 12/07/07 04:16 PM
Joined: Dec 2002
Posts: 2,019
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,019
I would call it a bug if it were happening for you and me too, but it's only happening to him. Has he tried different exe's in different directories with the same results? What about $msfile .. does that behave the same way for him?

//echo -a $msfile(*.*,$+(Choose the executable file of your media player)) $msfile(1) <-- this is msfile

1 C:\Program Files\Winamp\winamp.exe <-- this is msfile

~ Edit ~

For qwerty

Thanks to qwerty for my education in evaluation brackets in this thread, I know this...

Code:
//echo -a $msfile(*.*,$+(Choose the executable file of your media player)) $msfile(1) <-- this is msfile

1 C:\Program Files\Winamp\winamp.exe <-- this is msfile


can be replaced using this...

Code:
//echo -a $msfile( [ $msfile(*.*,Choose the executable file of your media player) ] ) <-- this is msfile

C:\Program Files\Winamp\winamp.exe <-- this is msfile


smile

Re: $isalias(sfile) is $false. [Re: RoCk] #180654 12/07/07 04:50 PM
Joined: Dec 2002
Posts: 17
V
voks Offline
Pikka bird
Offline
Pikka bird
V
Joined: Dec 2002
Posts: 17
Originally Posted By: RoCk
Has he tried different exe's in different directories with the same results?

Yep, he chose a file in the mirc directory and the result was his mirc directory.


using mirc 6.35 on WinXP Home SP3 and Windows 7
Re: $isalias(sfile) is $false. [Re: voks] #180655 12/07/07 05:04 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I'd suggest that kupotek copy and paste the exact line of code he is using when getting these results.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: $isalias(sfile) is $false. [Re: RoCk] #180660 12/07/07 06:36 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Glad you liked jaytea's article smile In this case however, evaluation brackets are not necessary. That's because the order of evaluation of nested identifiers is exactly the same as that of square brackets: the innermost element is evaluated first (if at the same depth, the order is from left to right). So in something like $a($b($c,$d)), the order of evaluation is $c, $d, $b, $a. In the case of $msfile, the inner one is evaluated first and returns the number of selected files; by the time that inner $msfile returns, mirc has already set up the data structure needed by the outer $msfile, so the latter will work correctly.

So why do we ever need evaluation brackets? Because without square brackets, the evaluation of inner identifiers will not change the way mirc separates the arguments of the outer identifier, ie in $a($b,$c), mirc determines that $a has been passed 2 arguments, even if $b or $c return something that contains a comma or a ). However, when brackets are used, things are different: in $a( [ $b ] ) for example, mirc evaluates $b before it has even begun parsing $a.

In short, square brackets inside identifiers are mainly (but not exclusively) used when a dynamic number of arguments is desired.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
$sfile returning path [Re: voks] #190435 20/11/07 11:42 PM
Joined: Dec 2002
Posts: 17
V
voks Offline
Pikka bird
Offline
Pikka bird
V
Joined: Dec 2002
Posts: 17
I just had another bug report of a user of my mp3ad+ script, where $sfile returned the path and not the complete path + filename.
Code:
$sfile(*.exe,$+(Choose the executable file of your media player))
returned
Code:
C:\Programme\iTunes\
He tried to get other files, too. Always with the same result: it returned the path. Same for $sfile with different parameters, e.g.
Code:
$sfile(itunes.exe,itunes.exe)

Code:
$isalias(sfile)
returned $false, so he didn't have any custom sfile alias, too.
Code:
$msfile(*.*,$+(Choose the executable file of your media player)) $msfile(1)
returned
Code:
0


He uses mIRC 6.31 (with NNScript 4.2).

P.S.: this thread should get a different subject and should be moved to bug reports section.

Last edited by voks; 20/11/07 11:48 PM.

using mirc 6.35 on WinXP Home SP3 and Windows 7
Re: $sfile returning path [Re: voks] #190436 21/11/07 12:01 AM
Joined: Dec 2002
Posts: 2,019
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,019

It worked correctly here...

//echo -a --> $sfile(*.exe,Choose the executable file of your media player)
--> C:\Programme\iTunes\itunes.exe

//echo -a --> $msfile(*.exe,Choose the executable file of your media player) $msfile(1)
--> 1 C:\Programme\iTunes\itunes.exe

v6.31 - XP Pro SP2 - NTFS

~ Edit ~

Originally Posted By: voks

...should be moved to bug reports section.



I would agree, if it were a problem with mIRC.


Re: $sfile returning path [Re: RoCk] #190437 21/11/07 12:19 AM
Joined: Dec 2002
Posts: 17
V
voks Offline
Pikka bird
Offline
Pikka bird
V
Joined: Dec 2002
Posts: 17
Working fine for me, too, as I mentioned some posts before.
Could my mp3ad+ script be the reason sfile behaves this way, and if yes, how, if $isalias(sfile) is false and so there's no custom sfile alias? Hundreds of mp3ad+ users don't have this problem. If you want to check the code, you can download my script here: http://mp3ad.markushenn.de/mp3ad+.zip but warning: more than 1000 lines of code. ;-)

Last edited by voks; 21/11/07 12:21 AM.

using mirc 6.35 on WinXP Home SP3 and Windows 7
Re: $sfile returning path [Re: voks] #190438 21/11/07 12:25 AM
Joined: Dec 2002
Posts: 2,019
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,019

Where in your script is $sfile failing? Which line.

Re: $sfile returning path [Re: RoCk] #190443 21/11/07 01:00 AM
Joined: Dec 2002
Posts: 17
V
voks Offline
Pikka bird
Offline
Pikka bird
V
Joined: Dec 2002
Posts: 17
Originally Posted By: RoCk

Where in your script is $sfile failing? Which line.

line 932 in mp3ad+ 2.20:
Code:
var %mp3+.exe = $sfile(*.exe,$+(Choose the executable file of your media player))
Nothing special so, and as I mentioned before: every use of $sfile, e.g. via "//echo -a", returns path without filename, too, for those guys.


using mirc 6.35 on WinXP Home SP3 and Windows 7
Re: $sfile returning path [Re: voks] #190444 21/11/07 01:03 AM
Joined: Jul 2006
Posts: 3,670
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,670
I'm sure that I've heard/seen that with some HDD, $shortfn will not work, whereas $qt will work
Maybe your issue is not related to what i said but since it happened with only few users, probably that this isn't a mirc problem.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: $sfile returning path [Re: Wims] #190446 21/11/07 01:22 AM
Joined: Dec 2002
Posts: 17
V
voks Offline
Pikka bird
Offline
Pikka bird
V
Joined: Dec 2002
Posts: 17
That's not the problem I think. Because the result of $sfile is already wrong, so the $qt identifier would just add some quotation marks around the path. ;-)
But about the $shortfn problem: perhaps the people try to use $shortfn for new (not yet existing) files. This doesn't work! It's only working for existing files.


using mirc 6.35 on WinXP Home SP3 and Windows 7
Re: $sfile returning path [Re: voks] #190448 21/11/07 01:36 AM
Joined: Jul 2006
Posts: 3,670
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,670
You misunderstood what i'm trying to explain, i mean that if there is some difference between $qt and $shortfn, maybe mIRC routine for $sfile/$msfile can be improved.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: $sfile returning path [Re: voks] #190449 21/11/07 01:58 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
When and where are you using the $isalias(sfile) ?

If you have a local alias in your script file, typing //echo -a $isalias(sfile) in an editbox will return $false. Try this:

Add a new alias within your mp3ad+ script file that is this:

Code:

alias checkit { echo -a $isalias(sfile) }



Then run the /checkit alias.

Also, have that specific person do the same thing. Maybe they somehow added an /sfile alias in their own mIRC. You may want to have that person do a simple find through all of their script files. Make sure you have them tick the "search all files in this section" in the script editor find function. They should search their alias and remotes files.

-genius_at_work

Last edited by genius_at_work; 21/11/07 02:01 AM.
Re: $isalias(sfile) is $false. [Re: RoCk] #190453 21/11/07 03:10 AM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
Originally Posted By: RoCk
Thanks to qwerty for my education in evaluation brackets


actually i wrote that article laugh but ye, the research i did was inspired by qwerty's post <3

edit: oops qwerty didnt notice you there!

edit2: guys, you can't overwrite internal identifiers, so a custom 'sfile' alias wouldn't be the source of the problem :P sounds like a minor fault, ask the guy to post a detailed bug report (windows version etc)

i wonder if he's experiencing problems with any other file access functions

Last edited by jaytea; 21/11/07 03:27 AM.

"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Re: $isalias(sfile) is $false. [Re: jaytea] #190475 21/11/07 02:04 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Technically you can:
alias sfile return yes we can!
//echo -a $.sfile(C:\)
//echo -a $/sfile(C:\)
//echo -a $/.sfile(C:\)

But that still wouldnt be the cause in this case :P


$maybe
Page 1 of 2 1 2