mIRC Home    About    Download    Register    News    Help

Print Thread
#262220 10/01/18 09:18 AM
Joined: Jan 2004
Posts: 2,127
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
This is likely related to the current $sfile() error being discussed. Use the following command to click on the c:\windows\fonts\ folder and it returns 1 without filling anything into $msfile(1)

Quote:
//echo -a selected files: $msfile(c:\windows\) filename: $msfile(1)

maroon #262221 10/01/18 10:07 AM
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Right. This is the same issue. mIRC was catering for it by checking if the returned filename is a directory and changing it to $null, which worked fine for $sfile(). However, with $msfile(), the Windows File dialog is doing the same thing, except it is returning a list of files. In this case, it returns a list that includes "C:\Windows\Font" as a filename, which it isn't.

If in $msfile() I select the Windows "Font" folder and two other normal files, the file dialog will return three items in the files list. Two are valid filenames and the third one (Fonts) is not valid.

How would you like this to be handled? There is obviously an error, however two of the items are valid filenames.

Would you like $msfile() to return an empty file list? and set $sfstate to "error"? Or to just remove "Fonts" from the returned file list and only return the filenames?

What if "Fonts" is the only item selected in the $msfile() dialog? Should $sfstate show an error?

Khaled #262222 10/01/18 10:33 AM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Selecting a valid folder + a valid file actually results in the file dialog opening the valid folder (if the folder is selected first).
Perhaps mIRC could mimic this and return an empty list with $sfstate returning "error" if the reserved/Fonts folder appears first in the list of returned filenames.
But if the first filename being returned is valid, then removes any reserved/Fonts folders from the list.
That would handle the case where "Fonts" is the only item selected (by returning empty list + $sfstate set to "error") as well as allowing valid filename to be returned if a valid filename is selected first


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard