EnriqueGonzalez Expert Licensed User Longtime User May 9, 2017 #1 Hi! I have a technical question. Having this code will always log -1 B4X: Dim rad As RadioButton = Sender Dim l As List = Array as radiobutton (radEsc0,radEsc1,radEsc2,radEsc3,radEsc4,radEsc5,radEsc6) Log(l.IndexOf(rad)) having this code will log the correct index: B4X: Dim rad As RadioButton = Sender Dim l As List = Array(radEsc0,radEsc1,radEsc2,radEsc3,radEsc4,radEsc5,radEsc6) Log(l.IndexOf(rad)) The question is why??? and the second question would be, should i always use the second option?
Hi! I have a technical question. Having this code will always log -1 B4X: Dim rad As RadioButton = Sender Dim l As List = Array as radiobutton (radEsc0,radEsc1,radEsc2,radEsc3,radEsc4,radEsc5,radEsc6) Log(l.IndexOf(rad)) having this code will log the correct index: B4X: Dim rad As RadioButton = Sender Dim l As List = Array(radEsc0,radEsc1,radEsc2,radEsc3,radEsc4,radEsc5,radEsc6) Log(l.IndexOf(rad)) The question is why??? and the second question would be, should i always use the second option?
R Roycefer Well-Known Member Licensed User Longtime User May 9, 2017 #2 Insert this into both your code snippets for an important clue: B4X: Log(GetType(rad) & " " & GetType(l.Get(0))) Upvote 0
Insert this into both your code snippets for an important clue: B4X: Log(GetType(rad) & " " & GetType(l.Get(0)))