• 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. Limit Form field data entry

Stats

  • Replies 3
  • Subscribers 160
  • Views 12612
  • Members are here 0
More Content

Limit Form field data entry

LP2R4T
LP2R4T over 14 years ago

Hello.

I want to limit form field data entry to numerical values(no minus values) but I am able to have minus signs entered The form field is a STRFILLIN

here is what I have used:

(case VCF->curField
  
  ("space_1_x_spaces"
  
   unless(forall(nStr, parseString(VCF ->curValue), rexMatchp("^[-]*[0-9]*[.]*[0-9][0-9]$", nStr))
    axlFormRestoreField(VCF, VCF ->curField)
      )))

 I though that the ^ was a negation.

Thanks in Advance

  • Sign in to reply
  • Cancel
  • eDave
    eDave over 14 years ago

    There are many ways you could do this - but why not use a real number form field in the first place and set the lower limit to 0?

    If you really must accept a string then a valid test (for a positive real number) might be:

    rexMatchp("^[0-9]+[.][0-9]+$", VCF ->curField)

    The "^" character at the beginning matches the start of the string - the "$" matches the end.

    Dave

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • LP2R4T
    LP2R4T over 14 years ago
    Thanks Dave,

    I am using a STRFILLIN because I want the users to be able to enter many real numbers at once in the same field.

    I would like it to be limited exactly the same as the grid spacing Set up menu in APD
    -  Multiple real numbers in the same field.
    - Only positive real number
    - With or without decimals.
     
    Can I use a logical operator with the rexMatchp to have more then one match possible?

     
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • LP2R4T
    LP2R4T over 14 years ago

    Dave,

    Here is what I have used "^[0-9]*[.]*[0-9]*$"

    It does what I need.

    Thanks

    • 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