My English is very poor, Try to explain the problem
(defun test2()
(setq a "OpenDcl is too powerful!!")
)
(defun c:test1()
(dcl_SendString "(test2)\n")
(setq a "OpenDcl is powerful!!")
)
Why after the completion of the c:test1,
variable a is "OpenDcl is too powerful!!" and not "OpenDcl is powerful!!".
How to let the variables A = "OpenDcl is powerful!!", According to order execution of c:test1.
Thanks..
If you want the function to be executed synchronously, you can just evaluate it directly:
(defun test2()
(setq a "OpenDcl is too powerful!!")
)
(defun c:test1()
(test2)
(setq a "OpenDcl is powerful!!")
)
Quote from: owenwengerd on July 15, 2012, 10:56:41 AM
If you want the function to be executed synchronously, you can just evaluate it directly:
(defun test2()
(setq a "OpenDcl is too powerful!!")
)
(defun c:test1()
(test2)
(setq a "OpenDcl is powerful!!")
)
thanks,owen.
I know you Idea. But sometimes I must use DCL_SENDSTRING to Solve some things.
For example,When my Modal Form is running and I want to write AUTOCAD Objet Database, Throw an exception of AUTOCAD.
eg. In Modal Form is Running
(defun c:MyTree_OnEndLabelEdit(NewValue Key)
....
(setq MyXRecordData '((12 34)(3 4)))
(if (setq e (xdrx_object_get "layer" "0")) ; Get Layer 0 Object and Set Extend Record.
(xdrx_object_set_xrecord e MyXrecordData) ;Throw an exception
)
....
)
however.
(defun WriteXrecord(val)
(if (setq e (xdrx_object_get "layer" "0")) ; Get Layer 0 Object and Set Extend Record.
(xdrx_object_set_xrecord e val) ;OK, not Throw an exception
)
)
(defun c:MyTree_OnEndLabelEdit(NewValue Key)
....
(setq MyXRecordData '((12 34)(3 4)))
(dcl_SendString "(WriteXrecord MyXRecordData)\n") ; Ok
....
)
My English is very poor, But I think you could understand I want to express meaning.and I Just use OPENDCL soon, Perhaps there is a better way? Please advice, thanks....
You must choose either synchronous or asynchronous execution. In your case, both should work if you implement your functions correctly. If you can post a complete example of your failing code, perhaps someone can help you resolve the problem.