Angelo2449
Utente Junior
- Professione: Pensionato
- Software: Autocad
- Regione: Lombardia
Salve a tutti,
sto tentando invano di far funzionare questo semplice programmino il lisp e dcl.
Le ho provate tutte, vorrei sapere perché no funziona, ringrazio anticipatamente.
sto tentando invano di far funzionare questo semplice programmino il lisp e dcl.
Le ho provate tutte, vorrei sapere perché no funziona, ringrazio anticipatamente.
Codice:
; MyYesNo - Question dialog with one question line
; Arguments: 2
; Title$ = Dialog Title
; Question$ = Question line
; Syntax: (MyYesNo " My Yes No" "Do you like creating programs in AutoLISP?")
;----------------------------------------------------------------------------------------------------------
(defun C:MyYesNo (Title$ Question$ / Answer$ Dcl_Id% Return#)
(princ "\nMyYesNo")(princ)
(setq Dcl_Id% (load_dialog "MyYesNo.dcl"))
(new_dialog "MyYesNo" Dcl_Id%)
(set_tile "Title" Title$)
(set_tile "Text1" Question$)
(action_tile "Yes" "(done_dialog 1)")
(action_tile "No" "(done_dialog 0)")
(setq Return# (start_dialog))
(unload_dialog Dcl_Id%)
(if (= Return# 1)
(setq Answer$ "Yes")
(setq Answer$ "No")
);if
(princ "\n")(princ Answer$)(princ);Optional
Answer$
);defun MyYesNo
//---------------------------------------------------------------------------------------------------------
// MyYesNo
// Note: The width for the Text1 key was determined by the syntax example and
// will need to be changed as per your requirements. Also note that the buttons
// for Yes and No, the added fixed_width = true;.
//---------------------------------------------------------------------------------------------------------
MyYesNo : dialog {
key = "Title";
label = "";//Title$ from lsp file
spacer;
: text {
key = "Text1";
label = "";//Question$ from lsp file
width = 35.0;
alignment = centered;
}
spacer;
: row {
fixed_width = true;
alignment = centered;
: button {
key = "Yes";
label = "&Yes";
is_default = true;
width = 7.92;
fixed_width = true;
}
: button {
key = "No";
label = "&No";
is_cancel = true;
width = 7.92;
fixed_width = true;
}
}
}//MyYesNo