Function Button1_onclick()
End Function
Dim Array1
Array1= Array
Item1="milk"
Item2="honey"
Item3="crackers"
So pretty much i want Button1_onclick() to put my Items there in a Textbox
im trying to figure this out methodically but not having any luck i have tried doing the following
B4X:
Function Button1_onclick()
Textbox1.value=array1
End Function
i have also tried
B4X:
Function Button1_onclick()
Dim Array1
Array1= Array
Item1="milk"
Item2="honey"
Item3="crackers"
Textbox1.value = Item1 + Item2 + Item3
End Function
however when i do get the items listed in my box... there is no carriage return, i have tried all the things i know such as vbCR vbLF vbCRLF
i have tried chr(10) chr(13).. nothing is working in this respect.
well how can i apply that to a VB control.. i mean VB doesnt have an EditText. and the textbox1 and textarea1 dont have a .text property
i just dont see how this applies at all to what im wanting to do.. perhaps if you explained further how this should help me
Hi,
I would suggest you download one of the basic tutorial programs and work thru them, you seem to be mixing microsoft VB with B4A VB they are similar but you are getting the syntax mixed up.
Consider B4A as Java to VB, not VB to Java. That is, the syntax is VB but all properties, methods, fields etc are Java. That makes sense to me, I hope it does to you too!
EditText1.Text is the equivalent to TextBox1.Value. There is no textarea in B4A.
So, here's a chunk of code that does exactly what you originally asked:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim editText1 As EditText
editText1.Initialize("editText1")
Activity.AddView(editText1,0,0,100%x,10dip)
editText1.SingleLine = False
Dim arr(4) As String
arr(0) = "milk"
arr(1) = "honey"
arr(2) = "crackers"
arr(3) = "cheese"
editText1.Text = arr(0)&CRLF&arr(1)&CRLF&arr(2)&CRLF&arr(3)
End Sub
As mentioned earlier in the thread, you really should work through the Beginners Guide