Hi, maybe this is something I am doing stupid!

I am using the IIF() function as follows...

Code:
IIf(MAPDRIVE($sDriveMap,,1) == 0, WriteAndDisplay("[OK]"), WriteAndDisplay("[WARNING] " + @SERROR))



However, if MAPDRIVE succeeds IIF seems to execute both WriteAndDisplay functions. However if I take the functions out so, i.e. "[OK]" is left and MAPDRIVE succeeds only the "[OK]" is executed hence written to the screen.

Any ideas on what is causeing this?

Thanks.

Lee.