Originally Posted By: Wims
I specifically mentioned the plain text $error value.
$error is an identifier filled when you use the goto :error but it is also a plain text value returned by some identifiers, $dde for example (I think there are some others but can't find them right now).
Using $false is the same idea as using plain text $error, but plain text $error makes more sense, nothing is false here.

Using plain text which looks like an identifier is (IMO) a bad idea for several reasons.

1. If you code this as you might naturally do, then it won't work:
Code:
if ($sfile(C:\) == $error) return

To make it work you have to code:
Code:
if ($sfile(C:\) == $ $+ error) return


2. "$error" is a valid file name. So if I select such a file in $sfile dialog how do you distinguish between the two?

For $sfile (or any identifier returning a file name) you would have to use text which is impossible to be a valid filename. According to Microsoft, the following characters are not valid in a filename: *?"<>|

How about using ? followed by an explanatory error message (either generated by Windows or mIRC)?

Last edited by Protopia; 14/11/17 12:21 PM.