My code does not run when initializing events

Started by EcObO, October 08, 2022, 04:17:11 PM

Previous topic - Next topic

EcObO

Good evening dear friends, please if someone could guide me, when i do the following routine:

where it loads the form, but it does not start any of the events, #OnInitialize or #OnClicked, what could be happening, thanks for the answers.

P.s. The form only has the following elements:

- a label (Etiqueta1)
- a text box (CajadeTexto1)
- a button (Botodetexto1)

My AutoCAD is 2021 and i use version 9.2.0.2, and I also tried with 9.1.5.2 and none of them run the events.



(defun c:hello()
  (command "_OPENDCL")
  (dcl_project_load "01_hello_world" T)
  (dcl_form_show 01_hello_world_Formulario1) 
  (princ)
)

(defun c:01_hello_world/Formulario1#OnInitialize (/)
  (dcl_MessageBox "Hello World!!!")
)
(defun c:01_hello_world/Formulario1_OnInitialize (/)  (dcl_Control_SetCaption 01_hello_world/Formulario1/Etiqueta1 "Type text to Box And Click Button")
  )

(defun c:01_hello_world/Formulario1/BotondeTexto1#OnClicked (/)
   (dcl_MessageBox "Hello World!!!")
  (setq txtBoxString (dcl-Control-GetText 01_hello_world/Formulario1/CajadeTexto1))
  (alert (strcat "Hi" txtBoxString))
)



owenwengerd

Likely your lisp event function names do not match the names in the .odcl file. If you open your .odcl file in OpenDCL Studio, you can copy/paste the event function names from studio to your lisp file.