Ed's suggestion is a good one, but personally I've always found that initget/getkword may seem perfectly feasible for the guy doing the coding but may not be intuitive for other users unless its for simple things like "Yes, No" "Ok, Cancel" type of stuff. An alternative solution would be to use a pop-up dialog to select your option really quick from a list.
Try substituting this snippet for your above snippet
Code:
;---------------------------------
(vl-load-com)
(tmpdia)
(setq dcl:id (load_dialog fn))
(if (not (new_dialog "temp_dialog" dcl:id))
(exit)
)
(setq lst (list "J. Marchal" "A. Scholten" "I. vdHorst"))
(start_list "plist")
(mapcar 'add_list lst)
(end_list)
(action_tile "accept" "
(setq *ans* (get_tile \"plist\"))
(done_dialog)")
(action_tile "cancel" "(done_dialog)")
(start_dialog)
(unload_dialog dcl:id)
(vl-file-delete fn)
(setq *ans* (nth (atoi *ans*) lst))
;---------------------------------
and add this sub-function to the end of your lisp file.
Code:
(defun tmpdia ()
(setq fn (vl-filename-mktemp "dcl.dcl"))
(setq fn (open fn "w"))
(write-line
"temp_dialog : temp_dialog : dialog { : popup_list { key = "plist"; label = "Select Name"; value = ""; } ok_cancel; }"
fn)
(close fn)
)
This is just another suggestion, if it works better for ya.
;edit, forgot some lines