Page 1 of 1 1
Topic Options
#192255 - 2009-02-13 05:55 PM MapDrive Question
coder Offline
Fresh Scripter

Registered: 2009-01-14
Posts: 39
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

Top
#192258 - 2009-02-13 06:16 PM Re: MapDrive Question [Re: coder]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Error codes are returned by MapDrive - simply display @SERROR immediately after the MapDrive function call.

 Code:
$Result = MapDrive(blah..)
If @ERROR
  'Mapdrive: ' @SERROR ?
EndIf


Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#192259 - 2009-02-13 06:18 PM Re: MapDrive Question [Re: Glenn Barnas]
coder Offline
Fresh Scripter

Registered: 2009-01-14
Posts: 39
Kewl. Thanks.

I was thinking I would have to set the error back into a variable or something.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.058 seconds in which 0.03 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org