• 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. copmpare variable to string

Stats

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

copmpare variable to string

ForcedToWork
ForcedToWork over 14 years ago

 

Very new at this... I'm trying to grab the layer purpose and compare it to a fixed string.  Here's a dumbed down version.  I can't find a way to compare the two even though lp returns ("drawing")

lp= geGetSelSet()~>purpose

 cond(

 (lp=="drawing" print("OK"))

 (lp=="pin" print("BAD"))

 

);cond

This returns nil

 

 Thanks

  • Cancel
  • skillUser
    skillUser over 14 years ago

    Hi,

    You are so close!  The problem is that geGetSelSet() returns a list of objects, but you are comparing the result as just one string as opposed to a list that contains a string.  The solution is modify the first line, something like this:

    
    lp= car(geGetSelSet())~>purpose
    

    This way you grab the first object on the list.  If you need to do this for multiple selected objects, then introduce a foreach loop or some other way to process multiple results (e.g. forall() ).

    Hope this helps!

    Lawrence.

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

     Thanks!!!  With a few more attempts I got the base lines working.  The "forall" loop worked, now just some clean up.  Thanks again, appreciate the help.

    • 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