pluton Active Member Licensed User Longtime User Aug 29, 2011 #1 OK I have label in my activity and i want that label show some text. Example: Dim lb As Label Dim t1,t2,t3 As String Dim i As Int i = 1 'later i will change value of i t1 = "First" t2 = "Second" t3 = "third bla bla" lb.Text = ("t" &i) And result is t1 How will i make that result is: First, Second or Third ???? :sign0104:
OK I have label in my activity and i want that label show some text. Example: Dim lb As Label Dim t1,t2,t3 As String Dim i As Int i = 1 'later i will change value of i t1 = "First" t2 = "Second" t3 = "third bla bla" lb.Text = ("t" &i) And result is t1 How will i make that result is: First, Second or Third ???? :sign0104:
Erel B4X founder Staff member Licensed User Longtime User Aug 29, 2011 #2 Code: Copy Dim numbers() As String numbers = Array As String ("First", "Second") ... lb.Text = numbers(i) Upvote 0
Code: Copy Dim numbers() As String numbers = Array As String ("First", "Second") ... lb.Text = numbers(i)
pluton Active Member Licensed User Longtime User Aug 29, 2011 #3 Thanks Erel I need that "i" because i will make some random words. If i stuck here I will ask again for help Upvote 0
Thanks Erel I need that "i" because i will make some random words. If i stuck here I will ask again for help
klaus Expert Licensed User Longtime User Aug 29, 2011 #4 I'm afraid you misunderstoud Erels post. With arrays the numbering begins with 0. Code: Copy Dim lb As Label Dim t(3) As String Dim i As Int i = 1 'later i will change value of i t(0) = "First" t(1) = "Second" t(2) = "third bla bla" lb.Text = t(i) or as Erel did, he used number instead of t like you and filled the array using the Array keyword. Code: Copy Dim t() As String t = Array As String ("First", "Second", "third bla bla") ... lb.Text = t(i) Best regards. Upvote 0
I'm afraid you misunderstoud Erels post. With arrays the numbering begins with 0. Code: Copy Dim lb As Label Dim t(3) As String Dim i As Int i = 1 'later i will change value of i t(0) = "First" t(1) = "Second" t(2) = "third bla bla" lb.Text = t(i) or as Erel did, he used number instead of t like you and filled the array using the Array keyword. Code: Copy Dim t() As String t = Array As String ("First", "Second", "third bla bla") ... lb.Text = t(i) Best regards.