• 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. skill code to manipulate string fields inside a form

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 14509
  • 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

skill code to manipulate string fields inside a form

Danilo P
Danilo P over 12 years ago

 Hello,

Could someone suggest the reason why the following skill is wrong? Simply I need to clean field1, field2 and field3 in the form, but the "foreach"cycle in the clean() procedure doesn't do that. Only I am able to clean the field 3, with the command outside from the cycle.

Is there any difference between the fist way and the second way? Of course this is just a very simplified example, my code is more complex and I need to delete fields whose names are member of a list.

Thank you

Danilo

procedure(test()

let(()

      fields = list(

            list( hiCreateStringField( ?name 'field1 ?prompt "Field1" ?value "10" ) 10:10 100:100 40)

            list( hiCreateStringField( ?name 'field2 ?prompt "Field2" ?value "20" ) 110:10 100:100 40)

            list( hiCreateStringField( ?name 'field3 ?prompt "Field3" ?value "30" ) 210:10 100:100 40)

            list( hiCreateButton(?name 'cleanButton ?buttonText "clean" ?callback "clean()") 10:100 50:50)

      )

      hiCreateAppForm(?name 'test_form ?formTitle "TEST FORM" ?initialSize t ?fields fields )

      hiDisplayForm('test_form)

))


procedure(clean()

let(()

      foreach(item list("field1" "field2")

            test_form~>item~>value = ""

      )

      test_form~>"field3"~>value = ""

))

 

 

  • Cancel
  • ztzg
    ztzg over 12 years ago
    Hi Danilo,

    > Could someone suggest the reason why the following skill is wrong?
    > Simply I need to clean field1, field2 and field3 in the form, but the
    > "foreach"cycle in the clean() procedure doesn't do that. Only I am
    > able to clean the field 3, with the command outside from the cycle.
    >
    > foreach(item list("field1" "field2")
    > test_form~>item~>value = ""
    > )

    The ~> infix operator maps to the getSGq macro, which quotes its second
    argument—so that it does not get evaluated as a variable. You could use
    the "naked" get function instead:

    let( (widget)
    foreach(item list("field1" "field2")
    widget = get(test_form concat(item))
    widget~>value = ""
    )
    )

    Cheers, -D

    --
    http://crosstwine.com
    tel: +49 89 2189 2939
    cell: +49 174 3489 428

    “Strong Opinions, Weakly Held”
    — Bob Johansen
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Danilo P
    Danilo P over 12 years ago

    Thank you very much.

    It works of course, but most important aspectfor me is that I learnt something I completely ignored before.

    Cheers, Danilo 

    • 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