• 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. convert '() to list()

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 2796
  • 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

convert '() to list()

loboveena
loboveena over 9 years ago

I am creating a form which has multiple tab fields and want to display only those tabs that meet a certain condition. So the output I get is of type list but in the format '() . The problem I have is providing this list to the ?fields argument of hiCreateTabField() function as it looks for the input in the format "list()" .

Is it possible to convert '() to list() in skill ?

I am aware of the visible/invisible option to do this but this is not what I want.

Thanks,

Veena

  • Cancel
Parents
  • loboveena
    loboveena over 9 years ago

    Andrew,

    Thanks for responding.

    The problem was that the ?fields argument was assigned nil. Hence hiCreateTabField failed. I had one more query. Hope I can ask it in the same post. 

    I am unable to get the tab names used in the form by providing tab value ?

    I tried the following; Created a sample form; See sample code below;

    1. f=hiGetCurrentForm()

    -- Returns form Id

    2. get(f->tabFld  nthelem(f->tabFld->value f->tabFld->fieldList))

    -- Returns page3 { as third tab was selected in the form) instead of tab name.  Is there anything I am missing here. How do I get the tab name from pagebasename# ?

    Thanks,

    Veena

    ;; Usage :: crTabForm('("flow1" "flow4"))

     

    procedure(crTabForm(flowTypeL)

    let( ( libFld cellFld viewFld lcvBB o1CellFld o2CellFld o3CellFld o4CellFld tabFld1 tabFld2 tabFld3 tabFld4 tabFld5

    form (fSize 620:500))

    ;; Basic Setup tab

    libFld = hiCreateStringField(

    ?name 'libFld

    ?prompt "Library"

    )

    cellFld = hiCreateStringField(

    ?name 'cellFld

    ?prompt "Cell"

    )

    viewFld = hiCreateStringField(

    ?name 'viewFld

    ?prompt "View"

    )

    o1CellFld = hiCreateStringField(?name 'o1CellFld ?prompt "Output Cell")

    o2CellFld = hiCreateStringField(?name 'o2CellFld ?prompt "Output Cell")

    o3CellFld = hiCreateStringField(?name 'o3CellFld ?prompt "Output Cell")

    o4CellFld = hiCreateStringField(?name 'o4CellFld ?prompt "Output Cell")

    ;;Setup

    tabFld1 = list(

    list(libFld 20:75 440:30 100 )

    list(cellFld 20:105 440:30 100 )

    list(viewFld 20:135 440:30 100 )

    )

    ;;Flow1

    tabFld2 = list(

    list(o1CellFld 30:210 440:30 100 )

    )

    ;;Flow2

    tabFld3 = list(

    list(o2CellFld 30:210 440:30 100 )

    )

    ;;Flow3

    tabFld4 = list(

    list(o3CellFld 30:210 440:30 100 )

    )

    ;;Flow4

    tabFld5 = list(

    list(o4CellFld 30:210 440:30 100 )

    )

    flds_to_be_displayedL=list(tabFld1)

    tabs_to_be_displayedL=list("Setup")

    foreach(f flowTypeL

    when(equal(f "flow1")

    flds_to_be_displayedL=append1(flds_to_be_displayedL tabFld2)

    tabs_to_be_displayedL=append1(tabs_to_be_displayedL "flow1")

    )

    when(equal(f "flow2")

    flds_to_be_displayedL=append1(flds_to_be_displayedL tabFld3)

    tabs_to_be_displayedL=append1(tabs_to_be_displayedL "flow2")

    )

    when(equal(f "flow3")

    flds_to_be_displayedL=append1(flds_to_be_displayedL tabFld4)

    tabs_to_be_displayedL=append1(tabs_to_be_displayedL "flow3")

    )

    when(equal(f "flow4")

    flds_to_be_displayedL=append1(flds_to_be_displayedL tabFld5)

    tabs_to_be_displayedL=append1(tabs_to_be_displayedL "flow4")

    )

    )

    printf("%L\n" flds_to_be_displayedL)

    tabFld = hiCreateTabField(

    ?name 'tabFld

    ?fields flds_to_be_displayedL

    ?tabs tabs_to_be_displayedL

    ?tabPlacement 'top

    ?value 1

    )

    form = hiCreateAppForm(

    ?name 'form

    ?formTitle "Custom Utility"

    ?dialogStyle 'modeless

    ?buttonLayout 'ApplyCancel

    ?initialSize fSize

    ?fieldFocus 'allTypein

    ?fields list(list(tabFld 1:5 620:500))

    )

    hiDisplayForm(form)

    t

    )

    )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • loboveena
    loboveena over 9 years ago

    Andrew,

    Thanks for responding.

    The problem was that the ?fields argument was assigned nil. Hence hiCreateTabField failed. I had one more query. Hope I can ask it in the same post. 

    I am unable to get the tab names used in the form by providing tab value ?

    I tried the following; Created a sample form; See sample code below;

    1. f=hiGetCurrentForm()

    -- Returns form Id

    2. get(f->tabFld  nthelem(f->tabFld->value f->tabFld->fieldList))

    -- Returns page3 { as third tab was selected in the form) instead of tab name.  Is there anything I am missing here. How do I get the tab name from pagebasename# ?

    Thanks,

    Veena

    ;; Usage :: crTabForm('("flow1" "flow4"))

     

    procedure(crTabForm(flowTypeL)

    let( ( libFld cellFld viewFld lcvBB o1CellFld o2CellFld o3CellFld o4CellFld tabFld1 tabFld2 tabFld3 tabFld4 tabFld5

    form (fSize 620:500))

    ;; Basic Setup tab

    libFld = hiCreateStringField(

    ?name 'libFld

    ?prompt "Library"

    )

    cellFld = hiCreateStringField(

    ?name 'cellFld

    ?prompt "Cell"

    )

    viewFld = hiCreateStringField(

    ?name 'viewFld

    ?prompt "View"

    )

    o1CellFld = hiCreateStringField(?name 'o1CellFld ?prompt "Output Cell")

    o2CellFld = hiCreateStringField(?name 'o2CellFld ?prompt "Output Cell")

    o3CellFld = hiCreateStringField(?name 'o3CellFld ?prompt "Output Cell")

    o4CellFld = hiCreateStringField(?name 'o4CellFld ?prompt "Output Cell")

    ;;Setup

    tabFld1 = list(

    list(libFld 20:75 440:30 100 )

    list(cellFld 20:105 440:30 100 )

    list(viewFld 20:135 440:30 100 )

    )

    ;;Flow1

    tabFld2 = list(

    list(o1CellFld 30:210 440:30 100 )

    )

    ;;Flow2

    tabFld3 = list(

    list(o2CellFld 30:210 440:30 100 )

    )

    ;;Flow3

    tabFld4 = list(

    list(o3CellFld 30:210 440:30 100 )

    )

    ;;Flow4

    tabFld5 = list(

    list(o4CellFld 30:210 440:30 100 )

    )

    flds_to_be_displayedL=list(tabFld1)

    tabs_to_be_displayedL=list("Setup")

    foreach(f flowTypeL

    when(equal(f "flow1")

    flds_to_be_displayedL=append1(flds_to_be_displayedL tabFld2)

    tabs_to_be_displayedL=append1(tabs_to_be_displayedL "flow1")

    )

    when(equal(f "flow2")

    flds_to_be_displayedL=append1(flds_to_be_displayedL tabFld3)

    tabs_to_be_displayedL=append1(tabs_to_be_displayedL "flow2")

    )

    when(equal(f "flow3")

    flds_to_be_displayedL=append1(flds_to_be_displayedL tabFld4)

    tabs_to_be_displayedL=append1(tabs_to_be_displayedL "flow3")

    )

    when(equal(f "flow4")

    flds_to_be_displayedL=append1(flds_to_be_displayedL tabFld5)

    tabs_to_be_displayedL=append1(tabs_to_be_displayedL "flow4")

    )

    )

    printf("%L\n" flds_to_be_displayedL)

    tabFld = hiCreateTabField(

    ?name 'tabFld

    ?fields flds_to_be_displayedL

    ?tabs tabs_to_be_displayedL

    ?tabPlacement 'top

    ?value 1

    )

    form = hiCreateAppForm(

    ?name 'form

    ?formTitle "Custom Utility"

    ?dialogStyle 'modeless

    ?buttonLayout 'ApplyCancel

    ?initialSize fSize

    ?fieldFocus 'allTypein

    ?fields list(list(tabFld 1:5 620:500))

    )

    hiDisplayForm(form)

    t

    )

    )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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