definition could not be loaded

definition could not be loaded

qkakkel
Contributor Contributor
5,942 Views
40 Replies
Message 1 of 41

definition could not be loaded

qkakkel
Contributor
Contributor

What goes wrong I try to load a lisp file but I get the message definition could not be loaded.

I am still a newbee with lisp!

 

(defun C:SAMPLE33 ()

(defun saveVars (/ readlist count item)

;;;---Setup a list to hold the selected items
(setq retlist (list))

;;;---Save the list setting
(setq readlist (get_tile "myList1"))

;;;---Setup a variable to run through the list
(setq count 1)

;;;---cycle through the list getting all of the selected items
(while (setq item (read readlist))
(setq retlist2 (append retList2 (list (nth item myList1))))
(while
(and
(/= "" (substr readlist count 1))
(/= "" (substr readList count 1))
)
(setq count (1+ count))
)
(setq readlist (substr readlist count))
)
;;;---Setup a list to hold the selected items
(setq retList2 (list))

;;;---Save the list setting
(setq readlist (get_tile "myList2"))

;;;---Setup a variable to run through the list
(setq count 1)

;;;---cycle through the list getting all of the selected items
(while (setq item (read readList))
(setq retlist2 (append retList2 (list (nth item mylist2))))
(while
(and
(/= " " (substr readlist count 1))
(/= "" (substr readlist count 1))
)
(setq count (1+ count))
)
(setq readlist (substr readlist count))
)
)


(setq myList1 (list "Electrical" "Structual" "Plumbing" "Foundation"))
(setq myList2 (list "Plastic" "Steel" "Aluminium" "Concrete"))

;;;---Load the dcl file from disk into memory
(if (not (setq dcl_id (load_dialog "SAMPLE33.dcl")))
(progn
(alert "The DCL file could not be loaded!")
(exit)
)

;;;---Else, the DCL file was loaded
(progn

 

;;;---Load the dialog definition inside the DCL file
(if (not (new_dialog "SAMPLE33" dcl_id))
(progn
(alert "The SAMPLE33 definition could not be loaded!")
(exit)
)

;;;---Else, the definition was loaded
(progn

(start_list "myList1" 3)
(mapcar 'add_list myList1)
(end_list)

(start_list "myList2" 3)
(mapcar 'add_list myList2)
(end_list)

;;;---if an action event occurs, do this function
(action_tile "accept" "(saveVars)(done_dialog 2)")
(action_tile "cancel" "done_dialog 1)")

;;;---Display the dialog box
(setq ddiag (start_dialog))

;;;---Unload the dialog box
(unload_dialog dcl_id)

;;;---if the user pressed the Cancel button
(if (= ddiag 1)
(princ "\n Sample33 cancelled!")
)

;;;---if the user pressed the Okay button
(if (= ddiag 2)
(progn


;;;---Inform the user of his selection from the first list
(princ (strcat "\n You chose "
(car retList)
"from the
first list box."
)
)

;;;---Inform the user of his selection from the second list
(princ "\n Your choise(s) from the second list box: ")
(foreach a retList2
(princ "\n ")
(princ a)
)
)
)

;;;;---Suppress the last echo for a clean exit
(princ)

)
)
)
)
)

 

0 Likes
Accepted solutions (1)
5,943 Views
40 Replies
Replies (40)
Message 41 of 41

paullimapa
Mentor
Mentor

once again there are a number of typos and also a couple off areas I added code to make Sample7 run smoothly. Search for ; error to discover where changes were made


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes