Split text when press Button!


#1

Hi dear,

please, can some help me?
i need split a text, when press Button2, for example:

thx u in advance…


#2

What is your criteria for splitting the text?
On the number of characters? On the presence of a specific character?

For splitting a string, the text block “segment text” with start and length arguments is the required one.
For determining if a character is a digit, the “is a number” is the one to use.


#3

can be number of characters…
i always will use 10 characters…


#4

Yes, but you split where?
Always 4/6?


#5

Split character x character… one to one


#6

You mean split in half? 5 one side and 5 the other?


#7

no,
split each character or letter… skip the (-)
other example

when i write basketball
then press button2
and split to :

b a s k e t b a l l

a character by each textbox


#8

image

This will split the text in individual characters, stored in a local list “splittext” (which could be a global variable just the same)


#9

this block split.
but how put each character in the each textbox?

I try it, but not work, sorry…

image


#10

That means you need 10 text box, and each has to be associated with one entry form the list.

You can do that by setting a list of component, and then looping them.

Here is an example with 3 components, but you can generalize to 10, or use textbox instead of labels:

image

To get the “setLabel.Text of component”, you need to expand the “any component” selection, like so:


#11

I try it, but not work

image

image


#12

That is because your components L1 and L2 are probably labels, while you are calling a TextBox group component.

You can either have L1 and L2 be ‘textbox’ and call ‘set TextBox’, or leave L1 and L2 as labels call the “set Label.Text of component”.

The any component approach is VERY component type specific. On that list ‘lista’ you could NOT mix buttons and spinner and label and textbox; they all have to be grouped in their own separate list, and the instruction is also very component type specific. In one of my app, I want to resize the text height of all labels and buttons and so on, I need to do it once for the labels, once for the button, once of the list picker and so on.


#13

all are textbox… no labels
in the example:
L1 = o
L2 = f
L3 = f
L4 = y

etc etc etc


#14

OK, I see the problem.

You set the value of lista as a list of “L1.Text” “L2.Text”.

That is incorrect.

You need to set it to a list of “L1” and “L2”. Note: no “.Text” !

Basically, you need to set the list of COMPONENTS. Not the list of their content.


#15

OK, I see the problem.

You set the value of lista as a list of “L1.Text” “L2.Text”.

That is incorrect.

You need to set it to a list of “L1” and “L2”. Note: no “.Text” !

Basically, you need to set the list of COMPONENTS. Not the list of their content.

work Perfectly !
thx u Monster ! :muscle:


#16

Mark it as “Solution” at your convenience.

That is the little check mark in a box at the bottom of the message.