Home > Community > Forums > Custom IC SKILL > accessing hiCreateToggleField individual values

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 accessing hiCreateToggleField individual values 

Last post Tue, Dec 10 2013 3:54 PM by DaveDesigner. 2 replies.
Started by DaveDesigner 13 Nov 2013 04:23 AM. Topic has 2 replies and 1766 views
Page 1 of 1 (3 items)
Sort Posts:
  • Wed, Nov 13 2013 4:23 AM

    accessing hiCreateToggleField individual values Reply

    Hello, I have been struggling for a long time trying to figure out how this hiCreateToggleField works. I can't seem to figure out how to access individual items that are actually selected by the user. I put together a little testcase that I think will help me understand if you could modify it to "only" print what is selected in the form?

    procedure(serdes_pop()
    let((popWhat singleLib allLib libChoice labelField lib)

     mylist=list( list( 'MT1 "MT1" ) list( 'MT2 "MT2" ) )

         popWhat = hiCreateToggleField(
                   ?name 'popWhat
                   ?prompt "Populate:"
                   ?choices mylist
                   ?itemsPerRow 1
                   )
      labelField = hiCreateLabel(
                   ?name 'myLabel
                   ?labelText "_________________________________________________"
                   )
         popForm=hiCreateAppForm(
                 ?name 'popFormdcr
                 ?formTitle "Populate cadencelibs"
                 ?callback 'popLib16CB
                 ?fields list(popWhat labelField)
                 ?unmapAfterCB t
                   )
         hiDisplayForm(popForm)
      );endlet
     );endprocedure

    procedure(popLib16CB(popForm)
    prog((singleLib)
    when(popForm
    foreach(a popForm->popWhat->_toggleItems
    print(symbolToString(a))
    )
        )
        return(t)
    ))

    • Post Points: 20
  • Tue, Dec 10 2013 3:39 PM

    • Li Ting
    • Not Ranked
    • Joined on Fri, Oct 2 2009
    • San Jose, CA
    • Posts 14
    • Points 220
    Re: accessing hiCreateToggleField individual values Reply

    Here is an example of how to use foreach with multiple iteration variables...

    procedure(popLib16CB(popForm)

        prog((singleLib)

    when(popForm

    foreach( (n v) popForm->popWhat->_toggleItems popForm->popWhat->value

    when( v print(symbolToString(n)) ) ) ) return(t) ) )

    • Post Points: 20
  • Tue, Dec 10 2013 3:54 PM

    Re: accessing hiCreateToggleField individual values Reply

    Li Ting, thank you very much for responding. This is very helpful!

     

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by DaveDesigner at 13 Nov 2013 04:23 AM. Topic has 2 replies.