• 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. Creating BooleanButtons from a list

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 13276
  • 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

Creating BooleanButtons from a list

climbnc
climbnc over 6 years ago

Hello,

I have the following list

listA = list("testA" "testB"  "testC")

and i want to create a boolean button for each list item to be able to add to a form.

i tried creating the buttons using the following and then adding the button to the form using hiAddField.  I believe the issue is that i do not have a variable name for the hiCreateBooleanButton.  

Im not sure how to have the variable name of hiCreateBooleanButton be the same as the variable buttonName.

Can anyone point out what i am missing or doing wrong please?

foreach(item listA

            buttonName = stringToSymbol(strcat(item "_booleanButton"))

            hiCreateBooleanButton (

            ?name buttonName 

            ?buttonText item

            )

           )

Thanks,

Chris

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Hi Chris,

    The variable that is used to store the fields doesn't require any special name - it's just a means of holding it prior to adding the field. So you could do either:

    foreach(item listA
      buttonName = stringToSymbol(strcat(item "_booleanButton"))
      newButton=hiCreateBooleanButton(
        ?name buttonName
        ?buttonText item
      )
      hiAddField(yourForm newButton) ; or use the 2D info if needed
    )

    or you could do:

    newButtons=foreach(mapcar item listA
      buttonName = stringToSymbol(strcat(item "_booleanButton"))
      hiCreateBooleanButton(
        ?name buttonName
        ?buttonText item
      )
    )

    In this second case, newButtons would be a list of the newly created buttons, and you could then use hiAddFields to add them, or do a foreach over newButtons to add them one at a time. You could potentially do something like this if you want the field positions:

    y=30
    newButtons=foreach(mapcar item listA
      y=y+30
      buttonName = stringToSymbol(strcat(item "_booleanButton"))
      list(
        hiCreateBooleanButton(
          ?name buttonName
          ?buttonText item
        )
        0:y 150:30 100
      )
    )

    hiAddFields(yourForm newButtons)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • climbnc
    climbnc over 6 years ago in reply to Andrew Beckett

    Thank  you Andrew.  This was very helpful.

    • 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