• 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. args _args

Stats

  • Locked Locked
  • Replies 10
  • Subscribers 144
  • Views 2827
  • 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

args _args

linbo
linbo over 14 years ago

Can't find definitions or explanation of these two terms in cds documentation.  Could someone help (either with explanation or point me to documentation?)

 

Thanks in advance,

--lin

  • Cancel
  • skillUser
    skillUser over 14 years ago

     Hi Lin,

    typically "args" would be used with something like a trigger function that automatically supplies arguments to the user-defined function.  In such situations "args" is used to gather input data in a structure, usually a disembodied property list.  For the purposes of SKILL Lint checking, if this argument is not used or referred to in the function, it would normally generate a warning (since the argument must be present, since this is how the trigger function is invoked by the tools), so here we can use "_args" to indicate that the argument is present, but we intentionally do not access it in the code.

    I hope that this explains things and answers your questions?

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago
    Hi Lin,

    In what context are you using these terms? I don't know what they mean otherwise...
    Put another way, why are you asking the question? What is it that you need to know?

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • linbo
    linbo over 14 years ago

     Hi Andrew,

    I'm trying to understand building custom menus.  I've seen two examples in the user forums, one uses args, the other uses _args.

     

    Thanks,

    --lin

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago
    Hi Lin,

    It would help if you gave a link to what you've seen - because there's almost certainly no special meaning to the word "args" or "_args" (other than the conventions Lawrence mentioned). In the context of a specific example, we can probably elaborate with more detail.

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Slayer
    Slayer over 14 years ago

     Maybe he wants to say, that when we use variable name without underscore, then it local variable if we use variable name with underscore, then we want to show, that it member of calss?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    That's not it. The name of a variable does not imply whether it's local or whether it's a "member of a class" (I assume you meant to say "class"). Not sure why you thought that.

    This is almost certainly a reference to a specific example - but without knowing what the specific example is, it's rather hard to comment!

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Slayer
    Slayer over 14 years ago

     Yes, I mean class. The question is, that sometimes some people use style, when if variable name begining with underscore _myVariable or m_myVariable they want to say, that it variable is class member.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    That is not a convention that's typically used for SKILL though. If a global variable or function begins with underscore, that is generally meant to imply that it is private (underscore followed by a prefix; Cadence users lowercase prefixes, whereas users should use prefixes that begin with uppercase).

    For function arguments, prefixing the name with underscore is meant to imply that the argument is intentionally not used - this is done in the case that Lawrence described where you have some trigger which requires an argument to be present, but you don't need to use it inside. SKILL Lint looks for such scenarios and uses this convention to disable the warning you'd otherwise get about unused arguments.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • linbo
    linbo over 14 years ago

     Hi Andrew,

     

    The context I found these in was on the forum talking about custom layout menus.  Here's the link to that thread:

    http://www.cadence.com/Community/forums/p/17476/1245483.aspx#1245483

    skilluser from Austin posts his solution...

    procedure(AmitAddMenu(args)

    and you post your solution...

    procedure(AmitAddMenu(_args)

    I was trying to discern why one would use the _ or not...

    Thanks!

    --lin

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 14 years ago
    Hi Lin,

    In that specific case you may note that Andrew's method (the correct approach) used a userMenuTrigger and because it is a trigger function it will be supplied a dpl structure with information in it, but the code did not need any of this information so there was no access to the "args" structure/variable, so the argument is renamed to _args so that SKILL Lint does not complain about the function argument being supplied but not used.  In my code example I accessed the window id from the structure passed in, and so I did use "args" within the procedure body, so Lint would not have complained about that, hence no need for the underscore preceding the variable name.

    Hopefully this explains why for this example, but Andrew's earlier post was clear I thought too.

    Regards,

    Lawrence.
    • 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