Author Topic: ObjectDCL bug?  (Read 146 times)

ziele_o2k

  • Member
  • *
  • Posts: 10
ObjectDCL bug?
« on: April 08, 2021, 02:09:16 PM »
I'm working with small project and I have some error which I don't understand:
This code is ok:
Code: [Select]
(defun c:CalculateReinforcement/Zginanie/TabStrip1#OnChanged (ItemIndex /)
    (cond
        ((= ItemIndex 0)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox4 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox3 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox7 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox8 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox9 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox1 T)
         ;(dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 103)
        )
        ((= ItemIndex 1)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox4 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox3 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox7 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox8 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox9 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox1 T)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 101)
        )
        ((= ItemIndex 2)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox4 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox3 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox7 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox8 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox9 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox1 nil)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 102)
        )
    )
    (princ)
)
But this one:
Code: [Select]
(defun c:CalculateReinforcement/Zginanie/TabStrip1#OnChanged (ItemIndex /)
    (cond
        ((= ItemIndex 0)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox4 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox3 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox7 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox8 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox9 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox1 T)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 103)
        )
        ((= ItemIndex 1)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox4 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox3 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox7 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox8 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox9 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox1 T)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 101)
        )
        ((= ItemIndex 2)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox4 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/ComboBox3 T)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox7 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox8 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox9 nil)
         (dcl-Control-SetEnabled CalculateReinforcement/Zginanie/TextBox1 nil)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 102)
        )
    )
    (princ)
)
end with error when dcl_Form_Show jums in

Edit:
Win10, AC2022
« Last Edit: April 08, 2021, 02:11:48 PM by ziele_o2k »

owenwengerd

  • Administrator
  • Hero Member
  • *****
  • Posts: 3037
    • Outside The Box
Re: ObjectDCL bug?
« Reply #1 on: April 08, 2021, 07:40:04 PM »
The error tells you that CalculateReinforcement/Zginanie/ZginanieIMG is NIL, which indicates some mistake in the control symbol. You can copy and paste the symbol name from the Studio property pane to be sure you have it right.

ziele_o2k

  • Member
  • *
  • Posts: 10
Re: ObjectDCL bug?
« Reply #2 on: April 08, 2021, 11:04:38 PM »
Thanks Owen for quick replay, but in my opinion code I posted is fine.
When window is loading this event is triggered:
Code: [Select]
(defun c:CalculateReinforcement/Zginanie#OnInitialize (/)
    (...)
    (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 103)
    (princ)
)
And it work ok.
This event works ok but when loading, OpenDCL returns error I posted earlier.
Code: [Select]
(defun c:CalculateReinforcement/Zginanie/TabStrip1#OnChanged (ItemIndex /)
    (cond
        ((= ItemIndex 0)
         (...)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 103)
        )
        ((= ItemIndex 1)
         (...)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 101)
        )
        ((= ItemIndex 2)
         (...)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 102)
        )
    )
    (princ)
)
Code below do not trigger error on load:
Code: [Select]
(defun c:CalculateReinforcement/Zginanie/TabStrip1#OnChanged (ItemIndex /)
    (cond
        ((= ItemIndex 0)
         (...)
         ;(dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 103)
        )
        ((= ItemIndex 1)
         (...)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 101)
        )
        ((= ItemIndex 2)
         (...)
         (dcl-Control-SetPicture CalculateReinforcement/Zginanie/ZginanieIMG 102)
        )
    )
    (princ)
)

Edit:
Tested on: Win10 AC2021 ZW2015 GStar2018