G grobi71 Member Licensed User Longtime User Nov 22, 2011 #1 Hallo all, is it possible in B4A to appand Chars to Variable names? Example: Dim btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9 As Button Dim Nr As Byte for Nr = 0 to 9 btn&"Nr".Top = 10 next i know that Nr is not a Char in this example. Grobi
Hallo all, is it possible in B4A to appand Chars to Variable names? Example: Dim btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9 As Button Dim Nr As Byte for Nr = 0 to 9 btn&"Nr".Top = 10 next i know that Nr is not a Char in this example. Grobi
klaus Expert Licensed User Longtime User Nov 22, 2011 #2 is it possible in B4A to appand Chars to Variable names? Click to expand... No, not directly. But what you can do is to create an array of buttons like this: Code: Copy Dim btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9 As Button Dim btns() As Button btns = Array As Button(btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9) For i = 0 To 9 btns(i).Text = i Next Best regards. Upvote 0
is it possible in B4A to appand Chars to Variable names? Click to expand... No, not directly. But what you can do is to create an array of buttons like this: Code: Copy Dim btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9 As Button Dim btns() As Button btns = Array As Button(btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9) For i = 0 To 9 btns(i).Text = i Next Best regards.
G grobi71 Member Licensed User Longtime User Nov 22, 2011 #3 Hallo Klaus, sometimes i think we are the onlyones here. Thanks for your reply. I will test it. It's for the Convert Program to make it easier to read. Great it works !! Grobi Last edited: Nov 22, 2011 Upvote 0
Hallo Klaus, sometimes i think we are the onlyones here. Thanks for your reply. I will test it. It's for the Convert Program to make it easier to read. Great it works !! Grobi