mIRC Home    About    Download    Register    News    Help

Print Thread
#182770 14/08/07 04:06 PM
Joined: Jun 2007
Posts: 156
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 156
i use it to store path
so i have

Code:
var %dir $sdir($mircdir,Choose new directory)
writeini $mircdirsystem\system.ini newdir dir %dir


and ok, if i choose new folder it writes it
but when i push cancel i get error of no folder being written

but how to make it detect if cancel was pushed so i can
halt that error ?

Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
Code:
var %dir = $sdir($mircdir,Choose new directory)
if (%dir) {
  writeini $mircdirsystem\system.ini newdir dir %dir
}
else {
  ; User pressed Cancel
}

Joined: Jun 2007
Posts: 156
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 156
thank you

Joined: Jun 2007
Posts: 156
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 156
not to open new thread...

does mirc have something for listing directories (like to dump them in variable)
like cmd has dir command ?

Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
Take a look at $finddir in the help file.

Joined: Jun 2007
Posts: 156
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jun 2007
Posts: 156
cool thanks

Joined: Jul 2006
Posts: 4,020
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
You can use $$sdir if you don't want to /writeini when you clik on cancel


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard