Home > Community > Forums > PCB SKILL > Form with

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Form with  

Last post Fri, Nov 5 2010 1:10 PM by EvanShultz. 11 replies.
Started by LP2R4T 01 Nov 2010 08:18 PM. Topic has 11 replies and 3076 views
Page 1 of 1 (12 items)
Sort Posts:
  • Mon, Nov 1 2010 8:18 PM

    • LP2R4T
    • Top 500 Contributor
    • Joined on Mon, Oct 19 2009
    • Posts 26
    • Points 460
    Form with Reply

    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

     

    Filed under:
    • Post Points: 35
  • Mon, Nov 1 2010 8:44 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 720
    • Points 15,610
    Re: Form with Reply

    Use REALFILLIN not STRFILLIN

    Dave Elder, Tait Communications
    • Post Points: 20
  • Tue, Nov 2 2010 4:43 AM

    • LP2R4T
    • Top 500 Contributor
    • Joined on Mon, Oct 19 2009
    • Posts 26
    • Points 460
    Re: Form with Reply

    eDave:

    Use REALFILLIN not STRFILLIN

    Takes Dave

    But What I want to acheive is to be able to have more then one real number in the same Field.Similar to the Grid Setup menu. 

    Regards

    Filed under:
    • Post Points: 5
  • Tue, Nov 2 2010 4:44 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 291
    • Points 4,640
    Re: Form with Reply

    REALFILLIN supports a single double precision number but if you require multiple numbers to be entered into a single field, you need to declare it to be a STRFILLIN, parse the input and use one of the family of axlMKSxxx APIs to convert the each resulting string value to a number.

    • Post Points: 35
  • Tue, Nov 2 2010 5:03 AM

    • LP2R4T
    • Top 500 Contributor
    • Joined on Mon, Oct 19 2009
    • Posts 26
    • Points 460
    Re: Form with Reply

    fxffxf:

    REALFILLIN supports a single double precision number but if you require multiple numbers to be entered into a single field, you need to declare it to be a STRFILLIN, parse the input and use one of the family of axlMKSxxx APIs to convert the each resulting string value to a number.

    Thanks I'll try that

    Filed under:
    • Post Points: 5
  • Thu, Nov 4 2010 11:07 AM

    • LP2R4T
    • Top 500 Contributor
    • Joined on Mon, Oct 19 2009
    • Posts 26
    • Points 460
    Re: Form Reply

    What would be the solution to limit the inputs of the Strfillin Field to accept only numerical values in order to avoid having text.

    Filed under:
    • Post Points: 35
  • Thu, Nov 4 2010 11:32 AM

    • aCraig
    • Top 50 Contributor
    • Joined on Sat, Aug 16 2008
    • Pepperell, MA
    • Posts 132
    • Points 2,070
    Re: Form Reply

    I don't believe you can *limit* STRFILLIN to only numerical values. What you can do is verify that only numerical values were entered in to the field. If it's not you can make the field active and send a message to the form to tell the user to use only numerical values. You could also use a confirmer with an example.

     Craig

    • Post Points: 5
  • Thu, Nov 4 2010 12:16 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 720
    • Points 15,610
    Re: Form Reply

    In your form callback routine you would need to have something like this:

    unless(rexMatchp("^[-]*[0-9]*[.]*[0-9]+$", formID ->curValue)
     axlFormRestoreField(form, formID ->curField), axlFormMsg(form, "warningmsg", "Invalid number")
    )

    Dave Elder, Tait Communications
    • Post Points: 35
  • Thu, Nov 4 2010 1:17 PM

    • LP2R4T
    • Top 500 Contributor
    • Joined on Mon, Oct 19 2009
    • Posts 26
    • Points 460
    Re: Form Reply

    Thanks Dave,

     I'm not fimilar with the following controls "^[-]*[0-9]*[.]*[0-9]+$" but if I want the form field STRFILLIN  to accept more then one set of numerical values in the same field like this 24.77 33.78 455.689 555.99 what would be the controls

     

    Filed under:
    • Post Points: 20
  • Thu, Nov 4 2010 1:51 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 720
    • Points 15,610
    Re: Form Reply

    Try something like:

    unless(forall(nStr, parseString(formID ->curValue), rexMatchp("^[-]*[0-9]*[.]*[0-9]+$", nStr))
     axlFormRestoreField(form, formID ->curField), axlFormMsg(form, "warningmsg", "Invalid number list")
    )

    Dave Elder, Tait Communications
    • Post Points: 5
  • Thu, Nov 4 2010 1:55 PM

    • LP2R4T
    • Top 500 Contributor
    • Joined on Mon, Oct 19 2009
    • Posts 26
    • Points 460
    Re: Form Reply

     To be more specific I want to the field to accept at least 4 numerical values (7 with 2 decimals) 1111111.11 2222222.22 3333333.33 4444444.44 

    Thanks Dave,

     I'm not fimilar with the following controls "^[-]*[0-9]*[.]*[0-9]+$" but if I want the form field STRFILLIN  to accept more then one set of numerical values in the same field like this 24.77 33.78 455.689 555.99 what would be the controls

    • Post Points: 20
  • Fri, Nov 5 2010 1:10 PM

    Re: Form Reply
    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.
    • Post Points: 5
Page 1 of 1 (12 items)
Sort Posts:
Started by LP2R4T at 01 Nov 2010 08:18 PM. Topic has 11 replies.