Using the MapDrive function in the UDF lib, how can I get the equiv of @Serror if it errors out.

Here is the code I have so fer, but I want to be able to enumerate the error in a print if it actually errors.

 Code:
Function WMapDrive($sLetter, $sPath)
  $result=MapDrive($sLetter,$sPath)
  If ($result = 0)
     ? "Drive $sLetter mapped to $sPath"
  Else
     ? "Drive $sLetter failed to map to $sPath(Error:" + $result + ")"
  EndIf
  $WMapDrive = $result
EndFunction



Opps Sorry I did not realize there was so many mapdrive udfs. I am using the one by Jens


Edited by coder (2009-02-13 06:03 PM)
Edit Reason: missed link