Q qsrtech Active Member Licensed User Longtime User Sep 28, 2012 #1 Hi, This might a just a shot in the dark, but is it possible to add (one day) being able to cast an object using something like this vs. creating a new variable every time: Code: Copy dim myList as List dim mt as TmyType ... mylist.add(mt) ... TmyType(mylist.get(y)).prop1=a 'prefered 'or (myList.get(y) as TmyType).prop1=a '2nd choice ... 'vs dim x as TmyType x=mylist.get(y) x.prop1=a As you can see it's pretty clean with the "prefered" choice Thanks! John P.S. are there any plans to add: Code: Copy With <object> prop1=a prop2=b End With you could then go with: Code: Copy With TmyType(mylist.get(y)) 'or With (myList.get(y) as TmyType) prop1=a prop2=b End With
Hi, This might a just a shot in the dark, but is it possible to add (one day) being able to cast an object using something like this vs. creating a new variable every time: Code: Copy dim myList as List dim mt as TmyType ... mylist.add(mt) ... TmyType(mylist.get(y)).prop1=a 'prefered 'or (myList.get(y) as TmyType).prop1=a '2nd choice ... 'vs dim x as TmyType x=mylist.get(y) x.prop1=a As you can see it's pretty clean with the "prefered" choice Thanks! John P.S. are there any plans to add: Code: Copy With <object> prop1=a prop2=b End With you could then go with: Code: Copy With TmyType(mylist.get(y)) 'or With (myList.get(y) as TmyType) prop1=a prop2=b End With
Erel B4X founder Staff member Licensed User Longtime User Sep 28, 2012 #2 It will be slightly simpler in v2.20: Code: Copy Dim x As MyType = mylist.Get(i)