i get this error message
; error: no function definition: OPFIL
aside from that it works the way i want to.
what im attempting to do is to place a button to allow me to open and select another file to be read.
any help is appreciated.
here is the lisp code
(setq fDATE (menucmd "M=$(edtime,$(getvar,date), MON DD YYYY)"))
(SETQ HFILE (STRCAT "c:\\DWG-History" FDATE ".txt"))
(setq file1 (open HFILE "r"))
(setq lista (list))
(while (setq rl1 (read-line file1))
(setq lista (append lista (list rl1)))
);end while
(close file1)
(setq lista (reverse lista))
(setq NT 0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq dclid (load_dialog "History.dcl"))
(new_dialog "History" dclid)
(defun edit_action1 (val)
(setq NT val)
)
(action_tile "Thelist" "(edit_action1 $value)")
(action_tile "cancel" "(done_dialog)(exit)")
(action_tile "page2" "(opfil)")
(start_list "Thelist")
(setq counta 0)
(while (setq wl1 (nth counta lista))
(add_list wl1)
(setq counta (+ counta 1))
);end while
(end_list)
(start_dialog)
(done_dialog)
(unload_dialog dclid)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "._VBASTMT" (strcat "AcadApplication.Documents.Open \"" (nth (atoi NT) lista) "\""))
(princ)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun opfil ()
(setq hfile nil)
(setq HFILE (getfiled "Select File" HFILE "txt" 0))
(setq file1 (open HFILE "r"))
(setq lista (list))
(while (setq rl1 (read-line file1))
(setq lista (append lista (list rl1)))
);end while
(close file1)
(setq lista (reverse lista))
)
here is the DCL code
History : dialog {
label = " History- Double Click ";
: list_box {
alignment = left;
key = "Thelist";
width = 50;
height = 30;
edit_width = 100;
}
spacer;
: row {
fixed_width = true;
alignment = centered;
: button {
width = 12;
label = "OK";
key = "accept";
is_default = true;
}
: button {
width = 12;
label = "Cancel";
key = "cancel";
is_default = true;
is_cancel = true;
}
: button {
width = 12;
label = "Open";
key = "page2";
is_default = true;
}
}
spacer;
}