• 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. How to insert a variable in a command? Please tell me how...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 7451
  • 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

How to insert a variable in a command? Please tell me how to use T_T

HJC
HJC over 2 years ago

Hello. Please tell me how to inser a variable in command.

I specified the follwing variables,

[variables]

1. test_aaa = "schSelectToolbar_10"

2. test_ins = "instances"

and i want to put the variables in place of "schSelectToolbar_10", "instances" in the following command.

[ command : swindow(10)->hiToolbars->schSelectToolbar_10->instances->checked=t ]

 

but, when i did follwing command,  The following error occurred in the CIW window.

[ command : swindow(num_wid)->hiToolbars->test_aaa->test_ins->checked=t ]

[ERROR Message]

*** Error in routine putprop:

Message: *Error* putprop: first arg must be either symbol, list, defstruct or user type

Entering new debug toplevel due to error:

 

I tried following command, it worked normally.

[ command : swindow(10)->hiToolbars->"schSelectToolbar_10"->"instances"->checked=t  ]

Please Tell me how to insert a variable in command .............. 

Thank you.

  • Cancel
Parents
  • p94todorov
    p94todorov over 2 years ago

    Hello,

    It looks like that you are trying to access a given property using a variable to hold the property name. When you use the ->  and ~> operators to set/retrieve given properties everything is treated as a literal (symbol). In case you want to use a variable for the property entry in your example you need to switch to a get structure at the given place. In your example the following should work:

    test_aaa = "schSelectToolbar_10"

    test_ins = "instances"

    [ command : get(get(swindow(num_wid)->hiToolbars test_aaa) test_ins)->checked=t ]

    Regards,

    Petar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • p94todorov
    p94todorov over 2 years ago

    Hello,

    It looks like that you are trying to access a given property using a variable to hold the property name. When you use the ->  and ~> operators to set/retrieve given properties everything is treated as a literal (symbol). In case you want to use a variable for the property entry in your example you need to switch to a get structure at the given place. In your example the following should work:

    test_aaa = "schSelectToolbar_10"

    test_ins = "instances"

    [ command : get(get(swindow(num_wid)->hiToolbars test_aaa) test_ins)->checked=t ]

    Regards,

    Petar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • HJC
    HJC over 2 years ago in reply to p94todorov

    Thank you very much !!!  p94todorov !!

    Thanks to yout help, the command work normally.

    And I have 1 question,

    you changed "swindow(num_wid)->hiToolbars->test_aaa"  to "get(swindow(num_wid)->hiToolbars test_aaa)"

    in the command here, "->" can be changed to "get()", is this a function to change the "->" mark at the end of the command?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • p94todorov
    p94todorov over 2 years ago in reply to HJC

    The get operator does pretty much the same as -> but it evaluates it's second argument, so it can be a variable or an expression. The -> treats whatever is on it's right-hand side as literal and unless there is a property with the exact given name it will return nil.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to p94todorov

    Petar's description is right (of course). A bit more background - when you use:

    a->b

    this is the same as the function call getq(a b) - and this is a syntax form in SKILL which doesn't follow the usual rules for functions (where arguments are all evaluated up front before the function is called). Because of this, the getq function evaluates its first argument (the variable containing the structure or disembodied property list), and takes the second argument literally as a symbol. No evaluation of the second argument is performed.

    The get() function is a traditional function which evaluates all its arguments up front. So the equivalent of a->b would be:

    get(a 'b)

    (i.e. you need to quote the second argument yourself). This means that you can do:

    slot='b
    get(a slot)

    There's no way of doing that with the -> operator, because it's just the same as using the getq() call.

    For completeness, if you do:

    a->b="hello"

    then this is equivalent to putpropq(a "hello" b). The third argument is treated literally. If you want the fully-evaluated form, you use putprop() instead:

    putprop(a "hello" 'b)

    Hope that helps!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • HJC
    HJC over 2 years ago in reply to p94todorov

    Thank you for your help !
    now, I understand get operation. Thank you again !

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • HJC
    HJC over 2 years ago in reply to Andrew Beckett

    Thank you for your detailed explanation !!

    • 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