Page 1 of 1

Filterfieldtext

PostPosted: Sun Jan 08, 2017 9:19 pm
by ger21
If I use "0123456789" for my Filterfieldtext, UCCNC still allows a decimal point ".", but appears to block everything else.
I need it to only allow integers.

Re: Filterfieldtext

PostPosted: Sun Jan 08, 2017 9:47 pm
by ger21
Does it matter if it's used for port and pin numbers?

Re: Filterfieldtext

PostPosted: Sun Jan 08, 2017 10:29 pm
by ger21
Vmax549 wrote:I don't think so as all DROs output as strings.

Not if you use Getfielddouble()?
I should have checked before, so I don't have to change about 300 right now. :cry:
It shouldn't be an issue, but I don't want someone entering 3.7 for a pin number.

Re: Filterfieldtext

PostPosted: Sun Jan 08, 2017 10:37 pm
by ger21
Vmax549 wrote:Ger I just looked and a port/pin dro is a "textfield " , updown type


Actually, every fields Objecttype is "textfield".

UpDown is a type, just like fieldnb and textfieldnb. They are all textfields.

So, I'm duplicating an UpDown, and originally used fieldnb. Let me plugin my breakout board and make sure textfieldnb works fine.

Re: Filterfieldtext

PostPosted: Mon Jan 09, 2017 2:12 am
by cncdrive
Gerry,

For the Textfilter to work you have to set the type property of the Textfield to textfield or textfieldnb.
These 2 types are to contain text, all other types are ment to be numeric types, so all other types can contain numbers only and so the textfilter does not work on them.
So, you will have to set the Textfield to one of the types which are made to contain text and then add the filter value of 0123456789 if you want to allow only these values and then it will not accept the . character.