mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,150
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
-$sfile

$sfstate does not return "error" when accessing a reserved folder with $sfile

Code:
//echo -a $sfile(C:\windows\) -- $sfstate
Select the Fonts folder, $sfile() returns $null as expected but $sfstate is not set to "error".
$sfstate is correctly set to "cancel" if we cancel the dialog, though.


-$msfile

You never really replied to me in here https://forums.mirc.com/ubbthreads.php/topics/262220 but it looks like you implemented my suggestion. But:

Code:
//echo -a $msfile(c:\windows\) -- $sfstate -- $msfile(0) -- $msfile(1)


Select a file and then select the Fonts folder, this displays:

Quote:
1 - error -- 1 -- C:\Windows\bootstat.dat
is $sfstate returning "error" correct behavior (indicating that something else than filenames were selected perhaps)?

Last edited by Wims; 14/01/18 09:51 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Code:
//echo -a $msfile(c:\windows\) -- $sfstate -- $msfile(0) -- $msfile(1)



For this example, it doesn't make sense that selecting the reserved folder after the filename causes $sfstate to return 'error' in a situation where $msfile(0) is positive and $msfile(1) is filled with a filename.

If any other folder had been click-on after the filename, the results for $msfile(0) and $msfile(1) would be filled identically, with $sfstate being $null instead of 'error'. I would think 'error' should be reserved for cases where you clicked on only a reserved folder or clicked on a filename in a way that doesn't fill it into $msfile(N)

Joined: Dec 2002
Posts: 5,421
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,421
Quote:
$sfstate does not return "error" when accessing a reserved folder with $sfile

Right, I see what has happened. It looks like the changes to set $sfstate for $msfile() affected $sfile(). This should be fixed for the next version.

Quote:
is $sfstate returning "error" correct behavior (indicating that something else than filenames were selected perhaps)?

Yes, the aim was to set $sfstate to "error" and to not return any files - this is how it will work in the next beta. Anything different to this behaviour is too complicated and will require changes to stable select file code used throughtout mIRC, so I will not be changing this.


Link Copied to Clipboard