Well, you appear to have the wrong ID for the combos.
You're writing the file on init, when you should be reading.
One event reads from
dat\amanti-op.txt and the other tries to write to
amanti-op.txtYou used "dname" as the dialog name which should have been "anti-op" or "$dname" ($dname returns 'anti-op' in this case).
You also have an 'edit' event with "if $did == 16" when id16 is a button. :tongue:
on *:anti-op:init:*:{ <-should be->
on *:dialog:anti-op:init:*:{ (Same for the other dialog event)
Few other issues (bracket mismatches, /fclose command outside of event, etc)
What is the format of the hostmark you're entering? Full hostmark (e.g. nick!identd@host.com) or a wildmask (e.g. *!*@host.com / *!identd@*.host.com / etc).
on *:dialog:anti-op:sclick:*:{
if $did == 16 {
; check if both combos have data
if $did(3) && $did(9) {
; add the data to the combo proper
did -a $dname 3 $did(3)
did -a $dname 9 $did(9)
; clear the edit field
did -d $dname 3,9 0
}
}
elseif $did == 17 {
if $did(3).sel || $did(9).sel {
did -d $dname 3,9 $v1
}
}
}
on *:dialog:anti-op:close:0:{
if $did(3,1) {
.fopen -no cc dat\amanti-op.txt
var %i = 1
while $did(3,%i) {
.fwrite -n cc $+($v1,:,$did(9,%i))
inc %i
}
.fclose cc
}
}
on *:dialog:anti-op:init:0:{
.fopen cc dat\amanti-op.txt
if !$ferr {
while !$feof {
if $fread(cc) {
tokenize 58 $v1
did -a $dname 3 $1
did -a $dname 9 $2
}
}
}
.fclose cc
}
NOTE: When called from a dialog event, $did() doesn't need the name field.