OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: andrew on September 20, 2010, 09:06:12 AM

Title: set caption retuning nil error?
Post by: andrew on September 20, 2010, 09:06:12 AM
im sure im just forgetting something simple but i can not set the caption
the dialog box pops up but the caption isnt being set
im using v6.0.0.27

here is my code snippet
check_file = a time string


;; Ensure OpenDCL Runtime is (quietly) loaded
(setq cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(command "_OPENDCL")
(setvar "CMDECHO" cmdecho)


; call the method to load the odcl file.
(dcl_Project_Load "stkfilecheck" T)

(defun display_notice (/)
(dcl_Form_Show stkfilecheck_Form1 )
;(dcl_Control_SetCaption stkfilecheck_Form1_Label1 check_file)
)

(if (/= check_file_time "11:20 AM")
(display_notice)
(dcl_Control_SetCaption stkfilecheck_Form1_Label1 check_file)
)

Title: Re: set caption retuning nil error?
Post by: owenwengerd on September 20, 2010, 09:38:27 AM
If your form is a modal dialog, then the (dcl_control_setcaption) call in your example would occur after the dialog is closed. Try putting that code in the form's OnInitialize event handler instead.
Title: Re: set caption retuning nil error?
Post by: andrew on September 20, 2010, 10:04:48 AM
thanks Owen that did the trick