dialog comby {
title ""
size -1 -1 124 86
option dbu
button "CLOSE", 1, 2 2 37 12, ok
button "ADD", 2, 2 20 37 12
button "DELETE", 3, 2 32 37 12
combo 4, 40 2 80 80, sort edit drop
}
; when you click on the CLOSE button
on *:dialog:comby:sclick:1: {
; find out how many entries there are
var %i = $did(comby,4).lines
;read from line last backwards
while (%i) {
; write the line to file, make sure it's not empty!
if ($did(comby,4,%i).text) write filename.txt $did(comby,4,%i).text
dec %i
}
}
; when you open the dialog GUI
on *:dialog:comby:init:*: {
; if your saved file exists
if ($exists(filename.txt)) {
; find out how many lines there are
var %i = $lines(filename.txt)
; and write them all
while (%i) {
did -a $dname 4 $read(filename.txt,%i)
dec %i
}
}
}