conliffe@caen.engin.umich.edu (Darryl C. Conliffe) (01/26/89)
I have a question. The code segment below returns the attached error message. What is the correct data structure to pass? First, the code segment: ;---------------------------------------------------------------------------- ; Setting choices ;---------------------------------------------------------------------------- #| ; DP_$ENUM_SET_CHOICES inserts an array of choices in the list of ; an enumerated task. New choices are added after the existing ; choice indicated by the "start" parameter. "N_choices" is the ; number of choices to add. If "truncate" is set to true, choices ; in the list following the newly inserted ones are deleted. This ; routine supersedes DP_$ENUM_REPLACE_CHOICES. (DEF-FOREIGN-TYPE dp_$string_array_t :array) (DEFINE-FOREIGN-FUNCTION 'dp_$enum_set_choices '((:IN task_id dp_$task_id ) (:IN start :integer16 ) (:IN n_choices :integer16 ) (:IN choices dp_$string_array_t) ;was UNIV (:IN truncate :boolean) (:OUT status status_$t ) ) :PROCEDURE) |# (defun replace-menu-elements () "Testing how to set/replace menu elements in DIALOG from LISP." (let* ((first-to-overwrite 1) (how-many 2) (choice-list (make-array 2 :initial-contents '("one" "two") :element-type 'string)) (choices choice-list) (truncate nil)) (dotimes (n 2) (print (aref choice-list n))) (setf status (dp_$enum_set_choices res_ele_enum_task first-to-overwrite how-many choices truncate 0) ) ) ) ---- Now when I get replace-menu-elements to execute, I get: "one" "two" >>Error: Illegal :array, :record, or :set argument #<Simple-Vector T 2 6CEFA3> to DP_$ENUM_SET_CHOICES DP_$ENUM_SET_CHOICES: Required arg 0 (TASK_ID): 70 Required arg 1 (START): 1 Required arg 2 (N_CHOICES): 2 Required arg 3 (CHOICES): #<Simple-Vector T 2 6CEFA3> Required arg 4 (TRUNCATE): NIL Required arg 5 (STATUS): 0 --- Any ideas? Better yet, any answers? Thanks in advance! -- ___________________ Darryl C. Conliffe conliffe@caen.engin.umich.edu (313) 721-6069 -------------------