KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

no mapping with similar code

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
dvine
KiXforms Novice
KiXforms Novice


Joined: 30 Sep 2008
Posts: 2

PostPosted: Tue Sep 30, 2008 7:05 am    Post subject: no mapping with similar code Reply with quote

Howdy,

I am just having a issue with a map that I have tried creating. I have an almost identical map which works perfectly, although this one does not.

Below is the code which I have been using. Does anybody see a problem with it?

If Exist("I" + ":")
Use "I" + ":" /DEL
If @ERROR <> 0
? "Error @ERROR Removing Drive Mapping for " I " (@SERROR)"
$Mapadrive = "Could not remove existing drive letter"
EndIf
Use $IntranetDrive $FilePrintServer + $IntranetShare
If @ERROR > 0
Color R + /N
? " Error " + $IntranetDrive + " Drive. " + @SERROR
$NoofErrors = $NoofErrors + 1
Else
Color W /N
? " Drive " + $IntranetDrive + " (" + $IntranetShare + ") - " + $IntranetDrive + " already in use."
EndIf
Else
$ErrDrive = $IntranetDrive
$ErrShare = $IntranetShare
Gosub ErrHandler
EndIf
Return

I have declared $IntranetDrive and $IntranetShare globally and the $fileprintserver has been delcared in another script. A similar map works although this one is not. I am new to this so I thought I'd ask if anybody sees anything wrong with this coding?

I see the script running the code correctly and echos the map at logon, although the drive does not appear in explorer.

Any help would be appreciated.

Thanks,

Eldin
Back to top
View user's profile Send private message
Mart
KiXforms Regular
KiXforms Regular


Joined: 03 Oct 2005
Posts: 57
Location: Rotterdam - Netherlands

PostPosted: Tue Sep 30, 2008 8:37 am    Post subject: Reply with quote

Ok, some small comments that come up when reading the code.

- This not the correct site for questions about kix. This site is dedicated to kixforms (a graphical add-on to kixtart). For kixtart questions please post at www.kixtart.org
- Please use the code tags when positing code. That way the code is much more readable because the formatting is preserved.
- Loose the GoSub. You can use a UDF to write the results to s file, send an e-mail, etc....
- The Exist function does not check for drive letters.
- Why not use "i:" instead of "i" + ":"?

_________________
Mart

- He's chained forever to a world that's departed.....It's not enough, it's not enough - Sorrow by Pink Floyd.
Back to top
View user's profile Send private message
dvine
KiXforms Novice
KiXforms Novice


Joined: 30 Sep 2008
Posts: 2

PostPosted: Tue Sep 30, 2008 11:24 pm    Post subject: Reply with quote

Whoops my apologies for posting the question in the wrong forum.

Thank you for your assistance. Will take all your notes into consideration and implement them.

Ta..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group