Hey all,

Here's one that it seems I should be able to figure out.

I have this function that I use to clean up after a screw-up:

function catcherror($errortext)
if @error <> 0
messagebox("$errortext",48)
del(c:\temp.bat)
exit
endif
endfunction

This works just fine. However, I want to be able to use it if both if's are negative in this structure:

if exist ("c:\lotus\notes\notes.ini")
$notesini = "c:\lotus\notes\notes.ini"
else
if exist ("c:\notes\notes.ini")
$notesini = "c:\notes\notes.ini"
else
*****catcherror("Could not find your notes.ini file.")*****
endif
endif

Problem, as you've probably already noticed, is that the value of @error is still 0, and therefore does not cause the exit action.

Is there a better way of writing the IF structure so that it will produce an error value? Is there an easy clean way of forcing the @error <> 0?

Thanks,
Chaz

mccachar@consultingprof.com