LucaMs Expert Licensed User Longtime User Dec 16, 2014 #1 I wanted to post some snippets to help us all. So I went to look through the VB.Net functions, hoping to find some for B4A. This is beautiful, very useful (unfortunately the description is in Italian): warning: DO NO USE SOMETHING LIKE: Dim MyArray() As String ... Dim Word As String = MyArray(4) USE: Dim Word As String = Choose(4, MyArray)
I wanted to post some snippets to help us all. So I went to look through the VB.Net functions, hoping to find some for B4A. This is beautiful, very useful (unfortunately the description is in Italian): warning: DO NO USE SOMETHING LIKE: Dim MyArray() As String ... Dim Word As String = MyArray(4) USE: Dim Word As String = Choose(4, MyArray)
wonder Expert Licensed User Longtime User Dec 16, 2014 #2 Hi Lucas, Can you elaborate? Perhaps translate the function to English?
LucaMs Expert Licensed User Longtime User Dec 16, 2014 #3 I had too much hurry (as usual ) It could be useful in rare cases. Choose(Index As Double, ParamArray Choise() As Object) As Object Selects and returns a value form a list of parameters. Index: Needed. Double. Numeric expression - must be a number between 1 and the number of elements of Choice. But Choice is not an Array, it is a ParamArray. This means that you could use: Dim Obj As Object = Choice(4, "Hello", 5, lvwItems, ... ) Last edited: Dec 16, 2014
I had too much hurry (as usual ) It could be useful in rare cases. Choose(Index As Double, ParamArray Choise() As Object) As Object Selects and returns a value form a list of parameters. Index: Needed. Double. Numeric expression - must be a number between 1 and the number of elements of Choice. But Choice is not an Array, it is a ParamArray. This means that you could use: Dim Obj As Object = Choice(4, "Hello", 5, lvwItems, ... )
NJDude Expert Licensed User Longtime User Dec 16, 2014 #4 Not to be a spelling Nazi but, the word is CHOICE not choise.
LucaMs Expert Licensed User Longtime User Dec 16, 2014 #5 NJDude said: Not to be a spelling Nazi but, the word is CHOICE not choise. Click to expand... Well, you are right but I had written two "choice" and two "choise", so you would have been able to make your... choize
NJDude said: Not to be a spelling Nazi but, the word is CHOICE not choise. Click to expand... Well, you are right but I had written two "choice" and two "choise", so you would have been able to make your... choize