• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. ComboField will not be updated

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 13773
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ComboField will not be updated

mschw
mschw over 7 years ago

Hello,

I have discovered a strange behaviour of Combo Fields within my SKILL-Code. I was able to narrow it down in the following minimal example:

button=
hiCreateButton(
     ?name 'button
     ?callback "deleteFromComboFieldCB()"
    ?buttonText "Delete"
);hiCreateButton

comboField=
(hiCreateComboField
     ?name 'comboField
     ?items list("Element A" "Element B" "Element /" "Element %")
     ?prompt "Elements"
    ?editable nil
);hiCreateComboField

(procedure deleteFromComboFieldCB()

myform->comboField->items=
(remd
     myform->comboField->value
     myform->comboField->items
);remd

myform->comboField->value=car(form->comboField->items);for updating combo field
);procedure


form=
hiCreateAppForm(
     ?name 'myform
    ?fields list(comboField button)
    ?formTitle "Simple Form"
);hiCreateAppForm

hiDisplayForm(form)

This example consists of a ComboField and a Button. When I select "Element A" (or "Element B") in the ComboField and press the Delete Button "Element A"  will be removed from the ComboField (as expected). When I select "Element /" (or Element %") and press the Delete Button "Element /" is still a selectable item within the Combo Field. When I check all items of the Combo Field using SKILL (myform->comboField->items)  I can see that "Element /" was deleted from the items , but the GUI wasn't updated. Is there a reason for the different behaviour or am I doing something completely wrong?

I use IC6.1.7-64b.500.17 

Many thanks in advance.

Kind regards,

Matthias

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Matthias,

    Replace the remd() by remove(). remd is a destructive list operator, and I think it must be something to do with the fact that you are modifying the list in memory. 

    What happens here is that the deletion only occurs properly if it's the first element that is being removed. That's consistent with the implementation checking to see if the pointer to the list of items changed - and if so, updating the choices in the combo-box; in the case of removing the first element, remd returns a pointer to the second element rather than the first so the list would have been seen as changed; in the case of removing anything other than the first, remd returns a pointer to the same list cell that it did before and I'm assuming this means that the UI doesn't think the list has changed. The actual ->items property is pointing to the SKILL list, so that appears to have been changed - it's just the actual items shown in the combo-box that don't change.

    Using remove() always returns a new list, so that always triggers the update.

    The dangers of side effects from destructive list functions!

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • mschw
    mschw over 7 years ago in reply to Andrew Beckett

    Andrew,

    thanks for your quick and detailed explanation. By replacing remd() with remove() everything works fine.

    Regards,

    Matthias

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information