• 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. Allegro X PCB Editor
  3. Form with

Stats

  • Replies 11
  • Subscribers 160
  • Views 16475
  • Members are here 0
More Content

Form with

LP2R4T
LP2R4T over 14 years ago

Hello,

How can I create a form with a fillin field that accepts multiple decimal values similar to the Grid spacing Setup menu in APD.

Spacing x: 25.00 25.00 25.00 

now the formfield looks like this:

FORMFILE FIELD current_grid_x_grids
FORMFILE FLOC 30 4
FORMFILE STRFILLIN 30 256
FORMFILE ENDFIELD

The problem is that it accepts all string values.. 

Thanks in advance

 

  • Sign in to reply
  • Cancel
  • EvanShultz
    EvanShultz over 14 years ago
    The part you're asking about is a regular expression (often shortened to regex or regexp). Look up rexCompile() or Google for details.

    What Dave has shown will accept only: an optional negative sign, zero or more integers, a optional period, and then one or more integers. This will capture any positive or negative number (integer or float).

    To accept only the 4 numbers you've shown, I think PCRE is simpler. Replace rexMatchp(...) with pcreMatchp("^[1-4]{7}.[1-4]{2}$" nStr). This will accept only: 7 integers between 1 and 4 in any order, a mandatory period, and 2 more integers between 1 and 4 in any order.

    Once you figure out how a regex works, it'll be simple to extend the code to accept exactly the 4 numbers you posted. I didn't do this because you typed "at least", so I take it there might be further changes required to accept numbers other than the 4 you listed above and I don't know what that might be.

    All the tools have been given to you within this thread. Take a few minutes to digest what's been posted, snoop around in the SKILL documentation and online, and you can figure it out. Then you'll be able to modify the regex yourself instead of asking for the answer. There are many smart and helpful people here, but there's nothing like figuring it out for yourself.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
<
Cadence Guidelines

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