• 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. Print combobox option in ciw window

Stats

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

Print combobox option in ciw window

saurabh96
saurabh96 over 4 years ago

Hey there,

How can i print combo box option (selected by user) in ciw window...Let me elaborate more...suppose..i have below combo box:-

rule1

rule2

rule3

.

.

.

rule10

now if user select rule2 and if i run the process..if process run successfully ..print rule2 completed in CIW.....same as if  user select rule 10  and  if process run fails.. print rule10 failed in CIW.

Thanks in advance.

srv

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Seriously?

    You write some code to do that. It's not hard.

    Andrew

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

    Hi Andrew,

    thanks fr reply,

    am getting an error while trying it as

    *Error* fprintf/sprintf: format spec. incompatible with data - "Format is '%s Completed ..please check log files\n', argument #1 is (\"2\")"

    below code i have tried

    rules_Entry=hiCreateListBoxField(
    ?name 'rules_Entry
    ?multipleSelect t
    ?choices (list "1" "2" "3" "4" "5" "6" "7" "8" "9"  ))

    rules_check = form->rules_Entry->value

    sumfile=simplifyFilename("./sum")
    if(system(strcat("grep -q '" "RUN COMPLETED" "' " sumfile))==0 then
    printf("%s Completed ..please check log files\n" rules_check)
    else
    warn("Rules Failed...please check log files\n")
    )

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

    Isn't that obvious, and something you could figure out with a little testing? For list boxes (so it's not even a combobox as you described in your original post), multiple selection is possible (you've even enabled it in your code snippet), so form->rules_Entry->value is a list of strings, not a single string.

    rules_check = buildString(form->rules_Entry->value ",")

    would fix your code above, because it takes the list of selected values and converts it into a single, comma-separated, string.

    Clearly you can see that providing a code example and the actual error makes it far easier to give you an answer (rather than requiring us to read your mind), but even so, your description didn't actually match what the code was doing!

    Andrew

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

    Thanks Andrew for explanation.

    i have one more question in above..i have made another test-case in which...

    rules_Entry=hiCreateListBoxField(
    ?name 'rules_Entry
    ?multipleSelect t
    ?choices (list "1 (a)" "2 (b)" "3 (c) " "4 (d)" "5 (e)" "6 (f)" "7 (x)" "8 (y)" "9 (z)"  ))  ;;;;where a,b,c defines the rules for particular no.

    rules_check = buildString(form->rules_Entry->value ",")

    printf("%s Completed ..please check log files\n" rules_check)

    in above case if i  select rule 1 and 2 , it print it will print like ( 1 (a) ,2 (b) ) completed...

    but i want that it will print only number come not alphabets as (1,2 completed).

    i have tried with grep and awk but it didnt work

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

    leadingNum=pcreCompile("^\\d+")
    filtered=foreach(mapcar entry form->rules_Entry->value
      pcreExecute(leadingNum entry)
      pcreSubstitute(leadingNum "\\0")
    )
    rules_check = buildString(filtered ",")

    or simpler still without needing patterns (if you just want to take the first word in your choices, i.e. using parseString to pull part the choice):

    rules_check = buildString(
      foreach(mapcar entry form->rules_Entry->value
        car(parseString(entry))
      )
      ","
    )

    Andrew

    • 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