• 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. hiCreateComboField() ?callback func

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 142
  • Views 4617
  • 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

hiCreateComboField() ?callback func

Yush
Yush over 1 year ago

hi,

I want to create three Combo fields to select lib, cell and view. Proactively identify whether the current cellName exists in the selected lib, and assign the first cellName of the selected lib if not exist.

But there was error when click OK Cancel Apply :Error in routine ilGetString:

Message: *Error* ilGetString: arg must be symbol or string. Entering new debug top level due to error:

I have no idea why trigger fields callback when click ok cancel apply?

procedure(testSelectCV()
let((lib cell view)
    lib = hiCreateComboField(
        ?name 'lib
        ?prompt "lib"
        ?items ddGetLibList()~>name
        ?callback "testSelectCV_SelCB(hiGetCurrentForm() \"lib\")"
    )
    cell = hiCreateComboField(
        ?name 'cell
        ?prompt "cell"
        ?callback "testSelectCV_SelCB(hiGetCurrentForm() \"cell\")"
    )
    view = hiCreateComboField(
        ?name 'view
        ?prompt "view"
        ?callback ""
    )
    testSelectForm = hiCreateAppForm(
        ?name 'testSelectForm
        ?formTitle "testSelectForm"
        ?fields list(
            list(lib 10:10 200:30 60)
            list(cell 10:50 200:30 60)
            list(view 10:90 200:30 60)
        );end fields 
    ?callback "");end create app form
    hiDisplayForm('testSelectForm)
    t);end let
);end proc

procedure(testSelectCV_SelCB(form \@optional field("lib"))
let((cells currentCell views currentView)
    cond(
        (field == "lib"                ;;Control cell field
            currentCell = form->cell->value
            when(artBlankString(currentCell)
                cells = ddGetObj(form->lib->value)->cells~>name
                form->cell->items = cells
                form->cell->value = car(cells)
            );end when
            unless(artBlankString(currentCell)
                cells = ddGetObj(form->lib->value)->cells~>name
                form->cell->items = cells
                unless(member(currentCell cells)
                    form->cell->value = car(cells)
                );end unless
            );end unless
        )
        (field == "cell"        ;;Control view field
            currentView = form->view->value
            when(artBlankString(currentView)
                views = ddGetObj(form->lib->value form->cell->value)->views~>name
                form->view->items = views
                form->view->value = car(views)
            );end when
            unless(artBlankString(currentView)
                views = ddGetObj(form->lib->value form->cell->value)->views~>name
                form->view->items = views
                unless(member(currentView views)
                    form->view->value = car(views)
                );end unless
            );end unless
        )
    );end cond
    t
    );end let
);end proc

  • Cancel
  • mbracht
    mbracht over 1 year ago

    Hi,

    I don't get this error. Apply doesn't do anything at all and both Ok as well as Cancel close the form...which is the expected behavior. And since you don't have any callbacks defined, what is that GUI supposed to do...I mean other than displaying the first cell and view of a selected library?

    Max

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to mbracht

    Also, it would be easier to use the ddHiCreate*ComboField functions which make all this a lot easier as they do the work for you. See my example code in this post (note there's a link to another post which gives a newer and expanded version of the example code too).

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Yush
    Yush over 1 year ago in reply to mbracht

    Thanks for reply, mbracht and Andrew, 

    My virtuoso version is 616, and ddHiCreate*ComboField functions can not be used in that version. Other blogger guess, click cancel after selecting libName, fields callback func was triggered, so the value of fields changed but not saved in form. When click cancel form is unmaped, the results is same as hiFormCancel done, fields callback were triggered, the return of hiGetCurrentForm is nil at this time,  error ocurred in callback function routine. 

    And I change hiGetCurrentForm to r_form, the problem solved. 

    hiGetCurrentForm() => nil ; form->lib->value or form->cell->value => error!

    Yush

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 1 year ago in reply to Yush

    I made a trial and the error actually occurs twice when you close (or cancel) the form
    (It doesn't raise an error with OK, or Apply)

    So the callback being triggered by leaving the edited fields makes sense (even though I'm surprised)



    Anyway, the error itself is actually coming when one of the following line returns nil.

    cells = ddGetObj(form->lib->value)->cells~>name

    views = ddGetObj(form->lib->value form->cell->value)->views~>name



    You can fix the error using a simpler coding style and doing the appropriate checks.

    You have weird statements:

      - You are using both `when' and `unless' when most people would use `if' or `cond'

      - You are using `cond' when `case' is more suitable



    Here is the updated code : 

    procedure(testSelectCV_SelCB(form @optional field("lib"))
    let((cells currentCell views currentView)
        case( field
            ("lib"                ;;Control cell field
                currentCell = form->cell->value
                ;; Fetch library cells
                unless( artBlankString(form->lib->value)
                    cells = ddGetObj(form->lib->value)->cells~>name
                )
                ;; Change cell only if :
                ;; - cells where found
                ;; - current cell is not among them
                when( cells
                    form->cell->items = cells unless( member(currentCell cells) form->cell->value = car(cells) ) ) ) ("cell" ;;Control view field currentView = form->view->value ;; Fetch cell views unless( artBlankString(form->lib->value) && artBlankString(form->cell->value) views = ddGetObj(form->lib->value form->cell->value)->views~>name ) ;; Change view only if : ;; - views were found ;; - current view is not among them when( views
    form->view->items = views unless(member(currentView views) form->view->value = car(views) ) ) ) );end cond t );end let );end proc

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Yush
    Yush over 1 year ago in reply to AurelBuche

    Thanks for help, AurelBuche, 

    The updated code sovled the error, but there maybe missing the code of assign value to cell/view field's items:

    form->cell->items = cells
    unless(member(currentCell cells)
    ......
    )
    the views case also missing

    Yush

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 1 year ago in reply to Yush

    You are right, I updated the code of my previous answer

    • Cancel
    • Vote Up +1 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