• 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. calling toggle field one at time

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 11078
  • 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

calling toggle field one at time

saurabh96
saurabh96 over 4 years ago

Hello Andrew,

I am looking to retrieve data selected from checkboxes in below code.

also user can selects only one toggle option at a time

Can you please provide an example.?

i have create one test-case in which i which am using toggle field-

prechk_toggle_Entry=hiCreateToggleField(
?name 'toggle_Entry
?choices list(list('aa "Reuse check1") list('bb "Reuse check1 & check2") ))

in above case if i select "Reuse check1" ..then value store in form should be -reuse p1 

if i choose "Reuse check1 & check2" ..then value store in form should be -reuse p1,p2

so that if user dumb the value of toggle selected in file it should as per above norms

regards,

srv

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    I have no idea what you're asking here - I don't know what "so that if user dumb the value of toggle selected in file it should as per above norms" means, nor what you are expecting. Some random observations:

    1. If the user can only select one toggle option at a time, you should probably use a radio button instead
    2. If you were hoping to translate the selected items into the strings p1 and p2 selectively, you can use something like:
      setof(elem foreach(mapcar (toggle data) someForm->toggle_Entry->value list("p1" "p2") toggle && data) elem)
      which will return a list of strings, depending on which were selected. You could buildString that into a single string, but I've no idea what you really want here.
    3. Posting questions in the forum solely addressed to me doesn't mean I'll necessarily be guilted into answering, and is quite likely you'll get ignored by one of the many other people able to answer because they are not called "Andrew"...

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Hi Andrew/Guys,

    am sorry for unclearance..let me go through this way..also i will keep above points while posting query.

    i have made an toggle fields as -

    toggle_Entry=hiCreateToggleField(
    ?name 'toggle_Entry
    ?choices list(list('aa "check1") list('bb "check1 & check2") ))

    hiCreateGridLayout(
    'checkframe
    ?frame "Check"
    ?items list(
    list(toggle_Entry 'row 0 'col 0)
    )
    )

    How should i retrieve data selected from checkboxes .Can you please provide an example.such that if i select "check1" in toggle field, value stored should be in string  form i.e -reuse p1    and  if i select "check1 & check2" in toggle field then value stored should be -reuse p1,p2.

    Hope it clears some clouds.

    Regards,

    SRV

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Hi Andrew/Guys,

    am sorry for unclearance..let me go through this way..also i will keep above points while posting query.

    i have made an toggle fields as -

    toggle_Entry=hiCreateToggleField(
    ?name 'toggle_Entry
    ?choices list(list('aa "check1") list('bb "check1 & check2") ))

    hiCreateGridLayout(
    'checkframe
    ?frame "Check"
    ?items list(
    list(toggle_Entry 'row 0 'col 0)
    )
    )

    How should i retrieve data selected from checkboxes .Can you please provide an example.such that if i select "check1" in toggle field, value stored should be in string  form i.e -reuse p1    and  if i select "check1 & check2" in toggle field then value stored should be -reuse p1,p2.

    Hope it clears some clouds.

    Regards,

    SRV

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    Given that toggle fields can have multiple selections (that's the point), then essentially you can use the code I gave above, but with the strings changed:

    listOfStrings=setof(elem foreach(mapcar (toggle data) yourForm->toggle_Entry->value list("-reuse p1" "-reuse p1,p2") toggle && data) elem)

    this will return nil, ("-reuse p1"), ("-reuse p1,p2") or ("-reuse p1" "-reuse p1,p2") depending on what you've selected. You can then manipulate that list and convert into a string as you wish.

    Or if you didn't want to use such cryptic code, you could just use:

    theString=cond(
       (yourForm->toggle_Entry->aa->value "-reuse p1")
       (yourForm->toggle_Entry->bb->value "-reuse p1,p2")
    )

    although this wouldn't handle the situation where both are selected. You could add a condition for that too, of course.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Much Thanks, Andrew!
    Appreciate your guidance!!!

    • 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