A arparker Member Licensed User Longtime User Mar 22, 2012 #1 Hi, I'm new to this programming language, although not to others such as C. I need to know how to type cast an array of Int into a custom Type(structure). Can someone provide an example for me? Regards, AL
Hi, I'm new to this programming language, although not to others such as C. I need to know how to type cast an array of Int into a custom Type(structure). Can someone provide an example for me? Regards, AL
Erel B4X founder Staff member Licensed User Longtime User Mar 22, 2012 #2 Unlike C it cannot be done automatically in Basic4android (or Java). You will need to create a sub such as: Code: Copy Sub Convert(Ints() As Int) As MyType Dim m As MyType m.aaa = Ints(0) ... Return M End Sub Upvote 0
Unlike C it cannot be done automatically in Basic4android (or Java). You will need to create a sub such as: Code: Copy Sub Convert(Ints() As Int) As MyType Dim m As MyType m.aaa = Ints(0) ... Return M End Sub
A arparker Member Licensed User Longtime User Mar 22, 2012 #3 Thank Erel for your reply. Although my Type has 198 unique elements that would need to be mapped so I may scrap the Type concept and use just the Int array and define 198 unique constants to index the array. This may prove to be less work. Upvote 0
Thank Erel for your reply. Although my Type has 198 unique elements that would need to be mapped so I may scrap the Type concept and use just the Int array and define 198 unique constants to index the array. This may prove to be less work.