WISH: Auto cast objects

qsrtech

Active Member
Licensed User
Longtime User
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:

B4X:
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:

B4X:
With <object>
    prop1=a
    prop2=b
End With

you could then go with:

B4X:
With TmyType(mylist.get(y))
'or
With (myList.get(y) as TmyType)
    prop1=a
    prop2=b
End With
 
Top