对话框冻结?有什么想法吗
大家好。嗯,我现在只做了大约一个星期的编程,所以我非常感谢任何帮助。当我运行SETUP1命令时,对话框冻结。它是否卡在一个循环中?我找不到问题。我对代码进行了反汇编和重新组装,但没有结果。我已附上以下代码。该程序的目的是将所有计划数据记录到一个位置,以便在计划更改时自动更新我们的数据库。我有一些独立工作的代码,但当我把它们放在一起时,它就会崩溃。我无法附加dcl文件。如果您想尝试代码,您需要调整“pldt”变量以适合您的计算机路径。如果你有任何问题,请告诉我。
(setq 8plt 97.125)
(setq 9plt 109.125)
(setq 10plt 121.125)
(setq flsys 14.75)
(setq cj 7.25)
(setq STYLE '("Cottage" "Drive Under" "Elite Ranch" "Estate" "J-Drive" "Traditional Front Load" "Traditional Rear Load" "Villa"))
(setq BED '("1" "2" "3" "4" "5" "6" "7" "8"))
(setq BATH '("1" "1.5" "2" "2.5" "3" "3.5" "4" "4.5" "5" "5.5" "6" "6.5" "7" "7.5"))
(setq pldt "C:\\Users\\toddreaves\\developer\\plandata.txt")
(defun c:SETUP1 ()
;define the function
(setq dcl_id (load_dialog "setup1.dcl"))
;load the DCL file
(if (not (new_dialog "Main" dcl_id))
;load the dialogue box
(exit)
;if not loaded exit
)
(start_list "sel1" 3)
(mapcar 'add_list STYLE)
(end_list)
(start_list "sel2" 3)
(mapcar 'add_list BED)
(end_list)
(start_list "sel3" 3)
(mapcar 'add_list BATH)
(end_list)
(setq found (findfile pldt))
(if (= found nil)
(progn
(setq count 0)))
(if (= found pldt)
(progn
(setq count 2)))
(while (= count 2)
(prompt "\nLoading Plan Data")
(setq fo (open pldt "r"))
(setq pl# (read-line fo))
(setq pln (read-line fo))
(setq dt (read-line fo))
(setq ela (read-line fo))
(setq elb (read-line fo))
(setq elc (read-line fo))
(setq eld (read-line fo))
(setq ele (read-line fo))
(setq elf (read-line fo))
(setq elg (read-line fo))
(setq elh (read-line fo))
(setq elj (read-line fo))
(setq styl (read-line fo))
(setq bd (read-line fo))
(setq bh (read-line fo))
(setq mstr (read-line fo))
(setq isl (read-line fo))
(setq sty (read-line fo))
(setq mplt (read-line fo))
(setq bsm (read-line fo))
(setq bplt (read-line fo))
(close fo)
(set_tile "eb1" pl#)
(set_tile "eb2" pln)
(set_tile "eb3" dt)
(set_tile "tog1" ela)
(set_tile "tog2" elb)
(set_tile "tog3" elc)
(set_tile "tog4" eld)
(set_tile "tog5" ele)
(set_tile "tog6" elf)
(set_tile "tog7" elg)
(set_tile "tog8" elh)
(set_tile "tog9" elj)
(set_tile "sel1" styl)
(set_tile "sel2" bd)
(set_tile "sel3" bh)
(cond ((= mstr "1")
(set_tile "rb10" "1"))
((= mstr "2")
(set_tile "rb11" "1"))
((= isl "1")
(set_tile "rb12" "1"))
((= isl "0")
(set_tile "rb13" "1"))
((= sty 1s)
(set_tile "rb14" "1"))
((= sty 1sa)
(set_tile "rb15" "1"))
((= sty 2s)
(set_tile "rb16" "1"))
((= sty 2sa)
(set_tile "rb17" "1"))
((= sty 3s)
(set_tile "rb18" "1"))
((= mplt 8plt)
(set_tile "rb19" "1"))
((= mplt 9plt)
(set_tile "rb20" "1"))
((= mplt 10plt)
(set_tile "rb21" "1"))
((= bsm "1")
(set_tile "rb22" "1"))
((= bsm "0")
(set_tile "rb23" "1"))
((= bplt nil)
(mode_tile "rb24" 1)
(mode_tile "rb25" 1)
(mode_tile "rb26" 1))
((= bplt "8plt")
(set_tile "rb24" "1"))
((= bplt "9plt")
(set_tile "rb25" "1"))
((= bplt "10plt")
(set_tile "rb26" "1")))
(setq count (1+ count))
)
(while (= count 0)
(prompt "\nNo Plan Data")
(set_tile "eb1" pl#)
(set_tile "eb2" pln)
(set_tile "eb3" dt)
(set_tile "tog1" 1)
(set_tile "tog2" 0)
(set_tile "tog3" 0)
(set_tile "tog4" 0)
(set_tile "tog5" 0)
(set_tile "tog6" 0)
(set_tile "tog7" 0)
(set_tile "tog8" 0)
(set_tile "tog9" 0)
(set_tile "sel1" 0)
(set_tile "sel2" 0)
(set_tile "sel3" 0)
(cond ((= bplt nil)
(mode_tile "rb24" 1)
(mode_tile "rb25" 1)
(mode_tile "rb26" 1)))
(setq count (1+ count))
)
(action_tile "eb1" "(setq pl# $value)")
(action_tile "eb2" "(setq pln $value)")
(action_tile "eb3" "(setq dt $value)")
(action_tile "tog1" "(setq ela $value)")
(action_tile "tog2" "(setq elb $value)")
(action_tile "tog3" "(setq elc $value)")
(action_tile "tog4" "(setq eld $value)")
(action_tile "tog5" "(setq ele $value)")
(action_tile "tog6" "(setq elf $value)")
(action_tile "tog7" "(setq elg $value)")
(action_tile "tog8" "(setq elh $value)")
(action_tile "tog9" "(setq elj $value)")
(action_tile "sel1" "(setq styl $value)")
(action_tile "sel2" "(setq bd $value)")
(action_tile "sel3" "(setq bh $value)")
(action_tile "rb10" "(setq mstr 1)")
(action_tile "rb11" "(setq mstr 2)")
(action_tile "rb12" "(setq isl 1)")
(action_tile "rb13" "(setq isl 0)")
(action_tile "rb14" "(setq sty \"1s\")")
(action_tile "rb15" "(setq sty \"1sa\")")
(action_tile "rb16" "(setq sty \"2s\")")
(action_tile "rb17" "(setq sty \"2sa\")")
(action_tile "rb18" "(setq sty \"3s\")")
(action_tile "rb19" "(setq mplt \"8plt\")")
(action_tile "rb20" "(setq mplt \"9plt\")")
(action_tile "rb21" "(setq mplt \"10plt\")")
(action_tile "rb22" "(setq bsm 1)")
(action_tile "rb23" "(setq bsm 0)")
(action_tile "rb24" "(setq bplt \"8plt\")")
(action_tile "rb25" "(setq bplt \"9plt\")")
(action_tile "rb26" "(setq bplt \"10plt\")")
(action_tile
"save"
"(setq flag 1)
(prompt "\nSaved")"
)
(while (= flag 1)
(setq fo1 (open pldt "w"))
(princ pl# fo1)
(princ "\n" fo1)
(princ pln fo1)
(princ "\n" fo1)
(princ dt fo1)
(princ "\n" fo1)
(princ ela fo1)
(princ "\n" fo1)
(princ elb fo1)
(princ "\n" fo1)
(princ elc fo1)
(princ "\n" fo1)
(princ eld fo1)
(princ "\n" fo1)
(princ ele fo1)
(princ "\n" fo1)
(princ elf fo1)
(princ "\n" fo1)
(princ elg fo1)
(princ "\n" fo1)
(princ elh fo1)
(princ "\n" fo1)
(princ elj fo1)
(princ "\n" fo1)
(princ styl fo1)
(princ "\n" fo1)
(princ bd fo1)
(princ "\n" fo1)
(princ bh fo1)
(princ "\n" fo1)
(princ mstr fo1)
(princ "\n" fo1)
(princ isl fo1)
(princ "\n" fo1)
(princ sty fo1)
(princ "\n" fo1)
(princ mplt fo1)
(princ "\n" fo1)
(princ bsm fo1)
(princ "\n" fo1)
(princ bplt fo1)
(princ)
(close fo1)
(setq flag (1+ flag))
)
;if SAVE selected do this
(action_tile
"accept"
"(done_dialog)
(setq flag 2)"
)
;if cancel selected do this
(action_tile
"cancel"
"(done_dialog)
(setq flag 0)"
)
;if cancel selected do this
(start_dialog)
;start dialog
(unload_dialog dcl_id)
;unload the dialogue
(princ)
);defun
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ);load clean
欢迎来到论坛。
(action_tile
"save"
"(setq flag 1)
(prompt "\nSaved")"
)
我最终去掉了这些,这使它部分工作。我现在在保存时遇到文件更新部分的问题。它应该用新数据覆盖文件,但事实并非如此。感谢您的回复。我真的非常感谢所有的帮助。
很高兴听到你这么说。
这是另一个问题,你应该再次检查你的代码。
页:
[1]