LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acceptence of characters in string control

Hello All,

 

i need to create array of strings (control) which will accept only numeric characters, and not letters.

For string control which is not array, i already did it, using some examples from this forum.

milan87_0-1655375340716.png

This works fine but there is problem by using delete, backspace and arrow buttons.

 

But, when string control is changed in to array of string controls, then i can type anything, not just numbers...

 

Can someone advise how to proceed?

 

Thanks.

0 Kudos
Message 1 of 19
(2,084 Views)

You can do the same by means of a dynamic event registered from the array element reference.

array element dynamic event.png

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 19
(2,074 Views)

Reminds me to this

https://xkcd.com/327/

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 3 of 19
(2,063 Views)

Why not just use an array of numerics?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 19
(2,048 Views)

Because later will be accepted for example 0-9, '-',':', and some other characters, posibly couple of letters.

That's why i need to have limitation which character can be enter in string, and not able to use numeric array.

 

0 Kudos
Message 5 of 19
(2,041 Views)

This is what I use to remove/ include certain characters in a string.Not sure if this will help you.

0 Kudos
Message 6 of 19
(2,020 Views)

Don't forget to catch Key Repeat? events (when user holds a key).

 

And you also need to catch Value Change events (when user does a copy-paste).

 

 

Message 7 of 19
(2,002 Views)

@milan87 wrote:

Because later will be accepted for example 0-9, '-',':', and some other characters, posibly couple of letters.

That's why i need to have limitation which character can be enter in string, and not able to use numeric array.

 


Then just do this:

paul_cardinale_0-1655396097565.png

 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 19
(1,984 Views)

@paul_cardinale wrote:

@milan87 wrote:

Because later will be accepted for example 0-9, '-',':', and some other characters, posibly couple of letters.

That's why i need to have limitation which character can be enter in string, and not able to use numeric array.

 


Then just do this:

paul_cardinale_0-1655396097565.png

 


I think OP means later the array of strings control must accept for "example 0-9, '-',':', and some other characters, possibly couple of letters".

 

So, that would require a strings.

0 Kudos
Message 9 of 19
(1,956 Views)

One more thing..

Could you please explain me why this work when we use dynamic user event and not when we just put array in event structure, and chose key down?

milan87_1-1655706244939.png vs

milan87_2-1655706335117.png

 

I'm asking because i use actor framework, and not sure how to implement this array element property node.

milan87_3-1655706432594.png

 

Thanks.

0 Kudos
Message 10 of 19
(1,898 Views)