Wish Initialize routine returns the object

Daestrum

Expert
Licensed User
Longtime User
Would it be possible (pretty please) to consider having the Initialize return the object in place of void.

Then all manor of wondrous things are possible eg

B4X:
dim iv as ImageView
dim im as Image
im.Initialize("path","file.png")
iv.Initialize("someFunction")
iv.SetImage(im)

could become

B4X:
dim iv as ImageView
dim im as Image
iv.Initialize("someFunction")
iv.SetImage(im.Initialize("path","file.png"))

Thank you.
 

Daestrum

Expert
Licensed User
Longtime User
Sorry if it's a lot of work, it's not really important, but gets closer to to the 'pure' Java way of using 'new' to create objects as you need them.

If I wanted really to ask for too much, I would ask for ImageView.iv.SetImage(Image.im.Initialize("somepath","somepic.jpg")) and get shot of the dim statements altogether
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…