• 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 question: How can I go to next loop of the f...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 19825
  • 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 question: How can I go to next loop of the foreach

wenckey
wenckey over 5 years ago

Just like the "next" function in perl.

How can I jump to the the next iteration of the loop in foreach.

Thanks

Kevin

  • Cancel
Parents
  • mbracht
    mbracht over 5 years ago

    Hi Kevin,

    You don't have these "jump to wherever" statements in SKILL  - there's no perl like "continue" or "last"  in SKILL either. I think it's considered to be bad coding style by the "die hard" SKILL programmers. So assume you have a list of lines you want to iterate over but skip the comment lines..in perl you go like this:

    foreach my $line @line {
       next if $line ~= /^#/ ;
       <
       ...remaining foreach body
       >
    }

    ...but in SKILL you need to handle that with a conditional statement:

    (foreach line lines
       (unless (rexMatchp "^#" line)
          <
          ...remaining foreach body
          >
       )
    )

    There's quite a view paradigms that work different in SKILL as opposed to the "C"-like languages and this is one of them.
    Even an early return from a function is not recommended, it fact it works from a prog() block only.

    Max

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • wenckey
    wenckey over 5 years ago in reply to mbracht

    Thanks a lot!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • wenckey
    wenckey over 5 years ago in reply to mbracht

    Thanks a lot!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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