• 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. *WARNING* Form 'Form', field 'check': Bad value "check5...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 1641
  • 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

*WARNING* Form 'Form', field 'check': Bad value "check5". Must be a list.

Drake96
Drake96 over 3 years ago

Hola everyone.

if the have one cyclic field that contains following check set-

check1

check2

check3

check4

check5

check=hiCreateListBoxField(
?name 'check
?multipleSelect t
?callback "back(hiGetCurrentForm())"
)

procedure(back(form)

if(form->check->value = "check5" then

op = outfile("./ffile" "w")
fprintf(op "success { \n")

close(op)
(view "ffile")
)

)

now,

Now ,when am running above script, so inspite which option is select(i.e. check1,2,3,4,5) its given "success"
I want that only when check5 is pressed then only it should print and view success.

can you show where its getting wrong

Kind regards,
Drake

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    Please provide complete examples - you seem to follow the pattern of your predecessor saurabh96 in not providing a full code example but snippets of code. Often that's not enough to show the problem.

    You talk in the subject line about cyclic fields, but this is not using a cyclic field. It's using a list box.

    Anyway, the problem is two-fold:

    1. Your callback is using "=" instead of "==". You're trying to check equality, not assign the value
    2. The ->value of a listbox (because it can have multiple items selected) is a list not a string

    Changing the condition in the callback function to:

    if(form->check->value == list("check5") then

    fixes the problem.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    Please provide complete examples - you seem to follow the pattern of your predecessor saurabh96 in not providing a full code example but snippets of code. Often that's not enough to show the problem.

    You talk in the subject line about cyclic fields, but this is not using a cyclic field. It's using a list box.

    Anyway, the problem is two-fold:

    1. Your callback is using "=" instead of "==". You're trying to check equality, not assign the value
    2. The ->value of a listbox (because it can have multiple items selected) is a list not a string

    Changing the condition in the callback function to:

    if(form->check->value == list("check5") then

    fixes the problem.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Andrew Beckett

    By a full example, I mean something like this - note I've added the extra code to allow the code to be run (this is after I made the fix). You're far more likely to get help if you minimise the amount of work somebody has to do when responding here - we're all doing this in our own time (including the Cadence folks like me - it's not part of my role at Cadence to respond here). If it involves a lot of repeated effort, you're likely to get ignored...

    ; indented the code to make it readable
    check=hiCreateListBoxField(
      ?name 'check
      ?multipleSelect t
      ?callback "back(hiGetCurrentForm())"
      ; the list of choices was missing
      ?choices list("check1" "check2" "check3" "check4" "check5")
    )
    
    procedure(back(form)
    
      ; fixed the condition
      if(form->check->value == list("check5") then
    
        op = outfile("./ffile" "w")
        fprintf(op "success { \n")
    
        close(op)
        (view "ffile")
      )
    
    )
    
    ; added a small form around the field to show the problem
    hiDisplayForm(
      hiCreateLayoutForm(
        'forum114
        "Forum114"
        hiCreateFormLayout(
          'lay
          ?items list(check)
        )
      )
    )
    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Drake96
    Drake96 over 3 years ago in reply to Andrew Beckett

    Andrew, am sorry for unclear quotations-
    thanks it was clear.
    i have write below code in which am trying that if i select all check together i get output like check1 success
    check 2 success.

    check 3 success.

    check 4 success.

    check 5 success.

    check=hiCreateListBoxField(
    ?name 'check
    ?multipleSelect t
    ?callback "back(hiGetCurrentForm())"
    ; the list of choices was missing
    ?choices list("check1" "check2" "check3" "check4" "check5")
    )

    procedure(back(form)

    ; fixed the condition

    op = outfile("./ffile" "w")
    fprintf(op "%s success \n" form->check->value)

    close(op)
    (view "ffile")
    )

    ; added a small form around the field to show the problem
    hiDisplayForm(
    hiCreateLayoutForm(
    'forum114
    "Forum114"
    hiCreateFormLayout(
    'lay
    ?items list(check)
    )
    )
    )

    if am selecting all rules and running ,error prompt is- *Error* fprintf/sprintf: format spec. incompatible with data - "Format is '%s success \n', argument #1 is (\"check1\")"

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Drake96

    As I explained before:

    Andrew Beckett said:
    The ->value of a listbox (because it can have multiple items selected) is a list not a string

    You are trying to print a string (with %s) but you are passing a list (as the error message states). Simplistically you could just change the %s to %L.

    Andrew

    • 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