I think I understand.

Since you use "if $FileExists" where the variable is the name of the function, @error is set to the function value overiding the "exit 2".

If you "dim $FileExists" then @error reports correctly.

If you "$FileExistxx = exist($filename) if $FileExistxx" then @error reports correctly.

If you "$nul = FileExists()" then @error reports correctly.

If you permit the function to report it value, it display its value "0" and then you ask @error to print which seems to have been set to the value of $FileExists as well.

[ 07 May 2002, 06:55: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/