Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with a dcl file

Status
Not open for further replies.

vbcad

Technical User
Jul 12, 2002
159
US
attached is some code for a lisp routine used in conjunction wiht a dcl file. i am trying to get the buttons to call a lisp routine for each radio button. a1, a2, e1 etc are the lisp commands. when i click the accept button i get a no function defined error. any ideas?

(defun c:FD()

;(defun saveVars()
; (setq but1(atoi(get_tile "choice1")))
; (setq but2(atoi(get_tile "choice2")))
; (setq but3(atoi(get_tile "choice3")))
; (setq but4(atoi(get_tile "choice4")))
; (setq but5(atoi(get_tile "choice5")))
; (setq but6(atoi(get_tile "choice6")))
; (setq but7(atoi(get_tile "choice7")))
; (setq but8(atoi(get_tile "choice8")))
; (setq but9(atoi(get_tile "choice9")))
; (setq but10(atoi(get_tile "choice10")))
; )
;
; (action_tile "choice1" "(setq A1)(done_dialog)")
; (action_tile "choice2" "(setq A2)(done_dialog)")
; (action_tile "choice3" "(setq F1)(done_dialog)")
; (action_tile "choice4" "(setq E1)(done_dialog)")
; (action_tile "choice5" "(setq E2)(done_dialog)")
; (action_tile "choice6" "(setq E3)(done_dialog)")
; (action_tile "choice7" "(setq M1)(done_dialog)")
; (action_tile "choice8" "(setq P1)(done_dialog)")
; (action_tile "choice9" "(setq P2)(done_dialog)")
; (action_tile "choice10" "(setq P3)(done_dialog)")
;
(setq dcl_id (load_dialog "dbcleanup.dcl"))
(if (not (new_dialog "dbcleanup" dcl_id) )(exit))
(action_tile "accept" "(setq ddiag 1)(saveVars)(done_dialog)")
(action_tile "cancel" "(setq ddiag 0)(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)

(if (= ddiag 0)
(princ "\n ...DBCleanup has been cancelled!")
)

; (if(= ddiag 1)
; (progn
; (princ "\n ...Processing -- please wait...")
; )
; (cond
; ((=choice1 1)(command "A1")
; ((=choice2 1)(command "A2")
; ((=choice3 1)(command "F1")
; ((=choice1 1)(command "E1")
; ((=choice1 1)(command "E2")
; ((=choice1 1)(command "E3")
; ((=choice1 1)(command "M1")
; ((=choice1 1)(command "P1")
; ((=choice1 1)(command "P2")
; ((=choice1 1)(command "P3")
; )
;
(princ)
)

(setq mySlideName "C:/Acad/Mayo.sld")
(setq myKey "sld")
(defun upDateImage (sldName key)
(upDateImage mySlideName myKey)
(setq width (dimx_tile key))
(setq height (dimy_tile key))
(start_image key)
(fill_image 0 0 width height 0)
(slide_image 0 0 width height sldName)
(end_image)
)

(princ "\n DBCLEANUP loaded! Type A1, A2, F1, E1, E2, E3, M1, P1, P2 or P3 to start!")
(princ)
 
I believe instead of (command "A1") you should use (c:a1)
 
that still didnt work. here is the exact error message.

error: no function definition: SAVEVARS

i have tried to modify the line ;(defun saveVars()
to ;(defun c:saveVars()but this has had no effect. any further ideas? it has to be something simple.
 
The 3rd line (tahd does not have a semicolon includes a call to 'savevars'.
>> (action_tile "accept" "(setq ddiag 1)(saveVars)(done_dialog)")

I haven't tried to figure out how this works. Why is the
;(defun saveVars()
routine "commented out"? Either put it back in, or remove calls to it.
 
I have taken the semicolons out. routine still does not work properly. Now when i load the routine the dialog pops up without typing FD at the command line. then when i run the routine i get no funtion definition savevars. i may have a parentheses in a wrong place. also is the red line below a problem? i will post the dcl code below the lisp code.

(defun c:FD()

(defun saveVars()
(setq but1(atoi(get_tile "choice1")))
(setq but2(atoi(get_tile "choice2")))
(setq but3(atoi(get_tile "choice3")))
(setq but4(atoi(get_tile "choice4")))
(setq but5(atoi(get_tile "choice5")))
(setq but6(atoi(get_tile "choice6")))
(setq but7(atoi(get_tile "choice7")))
(setq but8(atoi(get_tile "choice8")))
(setq but9(atoi(get_tile "choice9")))
(setq but10(atoi(get_tile "choice10")))
))

(action_tile "choice1" "(setq A1)(done_dialog)")
(action_tile "choice2" "(setq A2)(done_dialog)")
(action_tile "choice3" "(setq F1)(done_dialog)")
(action_tile "choice4" "(setq E1)(done_dialog)")
(action_tile "choice5" "(setq E2)(done_dialog)")
(action_tile "choice6" "(setq E3)(done_dialog)")
(action_tile "choice7" "(setq M1)(done_dialog)")
(action_tile "choice8" "(setq P1)(done_dialog)")
(action_tile "choice9" "(setq P2)(done_dialog)")
(action_tile "choice10" "(setq P3)(done_dialog)")

(setq dcl_id (load_dialog "dbcleanup.dcl"))
(if (not (new_dialog "dbcleanup" dcl_id) )(exit))
(action_tile "accept" "(setq ddiag 1)(saveVars)(done_dialog)")
(action_tile "cancel" "(setq ddiag 0)(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)

(if (= ddiag 0)
(princ "\n ...DBCleanup has been cancelled!")
)

(if(= ddiag 1)
(progn
(princ "\n ...Processing -- please wait...")
)
(cond
((=choice1 1)(command "A1")
((=choice2 1)(command "A2")
((=choice3 1)(command "F1")
((=choice1 1)(command "E1")
((=choice1 1)(command "E2")
((=choice1 1)(command "E3")
((=choice1 1)(command "M1")
((=choice1 1)(command "P1")
((=choice1 1)(command "P2")
((=choice1 1)(command "P3")
)

(princ)
)

(setq mySlideName "C:/Acad/Mayo.sld")
(setq myKey "sld")
(defun upDateImage (sldName key)
(upDateImage mySlideName myKey)
(setq width (dimx_tile key))
(setq height (dimy_tile key))
(start_image key)
(fill_image 0 0 width height 0)
(slide_image 0 0 width height sldName)
(end_image)
)

(princ "\n DBCLEANUP loaded! Type A1, A2, F1, E1, E2, E3, M1, P1, P2 or P3 to start!")
(princ)


start of dcl code
dbcleanup : dialog {
label = "Fix Database Drawing";
: image {
key = "sld";
height = 4;
width = 20;
color = -15;
is_enabled = false;
is_tab_stop = false;
}
: boxed_column {
label = "Choose drawing type to fix";
: radio_column {
: radio_button {
key = "but1";
label = "A1 Drawing";
}
: radio_button {
key = "but2";
label = "A2 Drawing";
}
: radio_button {
key = "but3";
label = "F1 Drawing";
}
: radio_button {
key = "but4";
label = "E1 Drawing";
}
: radio_button {
key = "but5";
label = "E2 Drawing";
}
: radio_button {
key = "but6";
label = "E3 Drawing";
}
: radio_button {
key = "but7";
label = "M1 Drawing";
}
: radio_button {
key = "but8";
label = "P1 Drawing";
}
: radio_button {
key = "but9";
label = "P2 Drawing";
}
: radio_button {
key = "but10";
label = "P3 Drawing";
}
}
}
: boxed_row {
: button {
key = "accept";
label = "Fix Drawing";
is_tab_stop = true;
is_cancel = false;
is_default = true;
mnemonic = "F";
}
: button {
key = "cancel";
label = " Cancel ";
is_tab_stop = true;
is_cancel = true;
is_default = false;
mnemonic = "C";
}
}
:text{
label = "Copyright ©2005 Mayo Foundation";
alignment = centered;
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top