Android Question edittext3.text = edittext1.text + edittext2.text

puang

Member
use datatype number :

edittext1.text = 1
edittext2.text = 2
edittext3.text = edittext1.text + edittext2.text

edittext3.text = 3 ( this ok... this work....)

but try use datatype text :

edittext1.text = "a"
edittext2.text = "b"
edittext3.text = edittext1.text + edittext2.text

edittext3.text = error ( expectations edittext3.text = ab )

any please help me...
 

puang

Member
Please use [code]code here...[/code] tags when posting code.

B4X:
EditText3.Text = EditText1.Text & EditText2.Text
Or:
B4X:
If IsNumber(EditText1.Text) And IsNumber(EditText2.Text) Then
 edittext3.text = edittext1.text + edittext2.text
Else
 edittext3.text = edittext1.text & edittext2.text
End If
#Erel, Thanks, i'am newbie learning and starting... glad to have joined this forum..
 
Top