• 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 2789
  • 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
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Veena,

    This doesn't make sense. The hiCreateTabField (or indeed any other function in SKILL) doesn't expect anything in list() or '() format. They require list objects, but they don't care how the list was formed. A list is a particular type in SKILL, and the  list() function and '() function are just two of many functions that can construct lists. list() builds a list from the evaluated values in its arguments, and '() creates a literal list with no evaluation - that's the only difference. So converting between the two makes no sense as it's unnecessary and once the list is a created, nothing has any knowledge of how it was created.

    Perhaps if you can describe your bigger problem or provide the code that has the issue, we might be able to give more specific advice?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • 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
  • loboveena
    loboveena over 9 years ago

    Hi Andrew,

    Could you let me know if it is possible to get the tab names by providing the tab value in a given form.  Am I missing something while creating the tabField ?

    Thanks,

    Veena

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Hi Veena,

    There are several ways to achieve this. One is to rely on a property
    on the form that is named such that it suggests it should be treated as
    private and liable to change:

    pageName=nthelem(f->tabFld->value f->tabFld->_hi_altNames)

    for example, this would give page_flow2.

    Personally I don't like this. For a start, it depends on a private property
    (the underscore at the beginning is the clue), plus it's encoded - so
    spaces get collapsed to underscores, and so on.

    So what I would do is store your tab names on each page. After the
    hiCreateTabField line in your code, I'd add:

    foreach((page tab) tabFld->fieldList tabs_to_be_displayedL
      get(tabFld page)->myTabName=tab
    )

    Now when you want to retrieve the tab name:

    tabName=get(f->tabFld nthelem(f->tabFld->value f->tabFld->fieldList))->myTabName

    so this would return "Setup", "flow1" etc.

    Regards,

    Andrew.

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

    Hi Andrew,

    This is awesome. This logic never stuck me. Thank you very much.

    Regards,

    Veena

    • 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