sachindkini Posted April 1, 2023 Posted April 1, 2023 (defun c:test2 () ;Command test2 (vl-load-com) ;load VLISP (setq tempname (vl-filename-mktemp "temp.dcl") filen (open tempname "w")) ;create temporary dcl (foreach stream '("kzzbss:dialog{" "\n label="temporary dialog";" "\n :popup_list{key="tag";label="Attributes:";list="List1\\nList2\\nList3\\nList4\\nList5\\nList6\\nList7\\nList8";}" "\n :edit_box{key="str"; label="value:";}" "\n ok_cancel;}") (princ stream filen)) ;Write the above data in temporary dcl (close filen) ;close file (setq dclname tempname) (setq dcl_re (load_dialog dclname)) ;load temporary dcl (if (not (new_dialog "kzzbss" dcl_re)) (exit)) (action_tile "accept" "(OKaction)(done_dialog 1)") ;Define the action for the OK button (action_tile "cancel" "(done_dialog)") (setq std (start_dialog)) (unload_dialog dcl_re) ;unload_dialog (vl-file-delete dclname) ;Delete temporary dcl files (if (= std 1) (run the program)) ;run (princ) ) error in above program Quote
Tharwat Posted April 1, 2023 Posted April 1, 2023 You need to add a backslash before each double quote when you include a string into another. '("kzzbss :dialog{" "label=\"temporary dialog\";" ":popup_list{key=\"tag\";label=\"Attributes:\";list=\"List1\\nList2\\nList3\\nList4\\nList5\\nList6\\nList7\\nList8\";}" ":edit_box{key=\"str\"; label=\"value:\";}" "ok_cancel;}") 1 Quote
sachindkini Posted April 1, 2023 Author Posted April 1, 2023 8 minutes ago, Tharwat said: You need to add a backslash before each double quote when you include a string into another. '("kzzbss :dialog{" "label=\"temporary dialog\";" ":popup_list{key=\"tag\";label=\"Attributes:\";list=\"List1\\nList2\\nList3\\nList4\\nList5\\nList6\\nList7\\nList8\";}" ":edit_box{key=\"str\"; label=\"value:\";}" "ok_cancel;}") thanks its working Quote
BIGAL Posted April 2, 2023 Posted April 2, 2023 (edited) Just a comment I use a library List box.lsp making a list dcl then you can use it in any code with out having to copy and edit the source into every code. Its just 2 lines of code, plus list. This version matches what was provided by Lee-mac. I have another similar. You could do it to what you have done. (setq lst (list "l1" "l2" "l3" "l4" "L5")) (if (not LM:listbox)(load "ListBoxV1-2.lsp")) ; loads the lisp if not already loaded (setq ans (LM:listbox "please choose " lst 1)) Edited April 2, 2023 by BIGAL 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.