OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Jim Short on July 29, 2008, 07:36:25 AM

Title: Varnames changed odcl code broken
Post by: Jim Short on July 29, 2008, 07:36:25 AM
Please can someone help me understand what is required to make this work now that control name are some kind of autocad entity. It use  to work in odcl.
Thanks, Jim

(defun tcam:SnapCtrlNames ()
  (list
    TahlCAD_TahlSnapsH_cbEnd
    TahlCAD_TahlSnapsH_cbMid
  )
)

(mapcar
  (function
    (lambda (a )
      (Dcl_Control_SetValue
   a
   1
      )
      (tcam:SnapCtrlNames)
    )
  )
)
Title: Re: Varnames changed odcl code broken
Post by: owenwengerd on July 29, 2008, 07:53:55 AM
How does your code fail?  Do you get an error message?
Title: Re: Varnames changed odcl code broken
Post by: Jim Short on July 29, 2008, 08:36:47 AM
if I
(list
    (quote TahlCAD_TahlSnapsH_cbEnd)
    (quote TahlCAD_TahlSnapsH_cbMid)
)
instead of
(list
    TahlCAD_TahlSnapsH_cbEnd)
    TahlCAD_TahlSnapsH_cbMid)
)
I get the error: ; error: invalid data type or data overflow: TAHLCAD_TAHLSNAPSH_CBEND

otherwise:


Title: Re: Varnames changed odcl code broken
Post by: BazzaCAD on July 29, 2008, 01:37:55 PM
I'm not sure if you're referring to the (dcl_Control_SetValue) in your code example or the (dcl_Control_SetEnabled) shown in the screen shot, but yes there where a number of changes from 4.1 to 5.0 that breaks existing code.

"SetEnabled" is expecting a Bool. T\nil & "SetValue" is expecting an integer 0,1,2

Per the Intelligent Help:
(dcl_Control_SetEnabled Untitled_Form1_TextButton1
newValue [as Boolean]) 

(dcl_Control_SetValue Untitled_Form1_Option1
newValue [as Integer]) 
Title: Re: Varnames changed odcl code broken
Post by: Jim Short on July 29, 2008, 06:14:04 PM
Thanks Barry,
That cleared everything up.
Cheers,
Jim :)