Adesu
2006-11-29, 07:32 AM
Hi Moderator and others,
I have a code,if user put a name in dialog box,and until 5 times it wrong,the dialog box could disappeared in drawing area,but fact my code still got trouble to do it,maybe over there,anyone have time to correction my code,where location am I did wrong,I very apreaciated for your help,thanks.
Here lisp file
; lnm is stand for Login Name Manager
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 29 November 2006
; Program no.: 0476/11/2006
; Edit by :
; ***** UNDER CONSTRUCTION *****
(defun c:lnm (/ ans cnt)
(setq dcl_id (load_dialog "Login Name Manager.dcl"))
(if
(not (new_dialog "lnm" dcl_id))
(exit)
) ; if
(set_tile "eb" "Abc")
(mode_tile "eb" 2)
(action_tile "eb" "(setq nam (get_tile \"eb\"))")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)(exit)")
(setq ans (start_dialog))
(if
nam
(progn
(if (= nam "")(c:lnm))
(if
(or (= nam "Adesu")(= nam "adesu"))
(progn
(alert (strcat "\nYou are right !!!"
"\n"
"\nMy name is "
"\n"
"\n" nam))
(exit)
) ; progn
) ; if
(setq cnt 0)
(while
(and (< cnt 5)(not (eq nam "Adesu"))(not (eq nam "adesu")))
(setq lst (append lst (list nam)))
(setq len (length lst))
(if
(= len 5)
(command "_quit")
) ; if
(setq cnt (1+ cnt))
(c:lnm)
) ; while
) ; progn
) ; if
(princ)
) ; defun
Here dcl file
// lnm is for Login Name Manager
lnm : dialog {label = "LOGIN NAME MANAGER";
: column {label = "Enter your name here";
: edit_box {key = "eb";}}
ok_cancel;}
I have a code,if user put a name in dialog box,and until 5 times it wrong,the dialog box could disappeared in drawing area,but fact my code still got trouble to do it,maybe over there,anyone have time to correction my code,where location am I did wrong,I very apreaciated for your help,thanks.
Here lisp file
; lnm is stand for Login Name Manager
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 29 November 2006
; Program no.: 0476/11/2006
; Edit by :
; ***** UNDER CONSTRUCTION *****
(defun c:lnm (/ ans cnt)
(setq dcl_id (load_dialog "Login Name Manager.dcl"))
(if
(not (new_dialog "lnm" dcl_id))
(exit)
) ; if
(set_tile "eb" "Abc")
(mode_tile "eb" 2)
(action_tile "eb" "(setq nam (get_tile \"eb\"))")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)(exit)")
(setq ans (start_dialog))
(if
nam
(progn
(if (= nam "")(c:lnm))
(if
(or (= nam "Adesu")(= nam "adesu"))
(progn
(alert (strcat "\nYou are right !!!"
"\n"
"\nMy name is "
"\n"
"\n" nam))
(exit)
) ; progn
) ; if
(setq cnt 0)
(while
(and (< cnt 5)(not (eq nam "Adesu"))(not (eq nam "adesu")))
(setq lst (append lst (list nam)))
(setq len (length lst))
(if
(= len 5)
(command "_quit")
) ; if
(setq cnt (1+ cnt))
(c:lnm)
) ; while
) ; progn
) ; if
(princ)
) ; defun
Here dcl file
// lnm is for Login Name Manager
lnm : dialog {label = "LOGIN NAME MANAGER";
: column {label = "Enter your name here";
: edit_box {key = "eb";}}
ok_cancel;}