#72714 - 2003-01-23 03:36 PM
RE: fnRemapDrives()
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Jens said... quote: If there are multiple errors while running this UDF the returned error code will be incorrect as you are adding all error codes.
-------------------- Jens
This was the intended behavior. As the Do loop enumerates the persistent drive mappings and successfully changes all registry entries the final error code will be zero. If there is one (or more) errors writing to the registry (which is highly unlikely) the error code will be greater than 0 as stated in the documentation. A -1 error code indicates that no match was found. [ 23. January 2003, 15:38: Message edited by: Chris S. ]
|
|
Top
|
|
|
|
#72715 - 2003-01-23 03:41 PM
Re: RE: fnRemapDrives()
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
BTW, here is the link to fnRemapDrives()
|
|
Top
|
|
|
|
#72720 - 2003-01-23 04:07 PM
Re: RE: fnRemapDrives()
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
My dilema with this UDF was that the user could have any number of mapped drives with the target server's name in it. If I only use the last error code, i.e.
code:
$rc=WRITEVALUE(...) if @ERROR $err=@ERROR endif
...then a failed write error code could potentially be overwritten by a successful one. The only option would be to exit the UDF on any WriteValue() error.
|
|
Top
|
|
|
|
#72728 - 2003-01-23 05:33 PM
Re: RE: fnRemapDrives()
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
|
|
Top
|
|
|
|
#72732 - 2003-01-23 06:27 PM
Re: RE: fnRemapDrives()
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Sadistic, hippophilic necrophile
or, in plain English...
beating a dead horse.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|