Question about EditText

pmj

Member
Licensed User
Longtime User
I have a question about EditText

An example:

Dim a as int
Dim t1, t2, t3, t4, t5, t6, t7 as EditText

for a = 1 to 7
if "some text" = t & a & ".Text" then "do something"
Next

The above example does not work - but is it possible to get it to it somehow?

(This is translated with Google translate - so if you do not understand it then give Google the blame :D)
 

kickaha

Well-Known Member
Licensed User
Longtime User
Try putting the EditText in an array, some snippets of code:
B4X:
'in Sub Globals
Dim EditTextArray() As EditText

'in Sub Activity_Create(FirstTime As Boolean)
EditTextArray = Array As  EditText(t1, t2, t3, t4, t5, t6, t7)

' you can then use this code
for a = 0 to 6
if "some text" = EditTextArray(a).Text then "do something"
Next
 
Upvote 0
Top