Yes. The code you posted will work.Will it work for all types? For example can I use it for casting any object to its known type?
Yes. The code you posted will work.Will it work for all types? For example can I use it for casting any object to its known type?
No. It is not a "real" method. It is a compiler feature.If we write a library - do we supply the 'As' method and return valid conversions?
Yes.Please anyone who knows of another forum where users often gets input of new upcoming features and can actually effect changes in that new feature before its final release, then please point me to that forum. I've never seen that happen on any other forums as usually the developers just release what they think is correct and their users just have to live with it.
It's not the same thing, nowhere near.Yes.
POLL: What do you use B4X for
I may participate if you added "for learning programming" option. Donewww.b4x.com
It is still true. For example, in HMG, users also contribute towards the development.
@alwaysbusy you made me almost drop my tears. The post is so touching when I read it. ?This reminds me of what I read a few days ago in another forum. There was a small war inside ?
P.s I am wondering who is the OP
Why prefer XoJo instead of B4x?
I want to know why you prefer XoJo instead using B4x for Desktop, Android, IOS and Web? All of this can be done with B4x, Desktop as Java App but with native packing for Mac, Linux and Windows, IOS and Android are native Apps. WebApps can be done as Server based Webapp or PWA with B4J Banano and...ifnotnil.com
So instead of using the CastTo keyword, replacing it with As is much much shorter keystrokes and comfortable to my eyes and brain.B4X:buttons.Get(2).CastTo(B4XView).Text = "less boring"
Yes, 'CastTo' sounds more complicated and may require some explanation of the inner workings. 'As' is more linguistic and natural. Good choice!So instead of using the CastTo keyword, replacing it with As is much much shorter keystrokes and comfortable to my eyes and brain.
Well, I had to leave something for Erel, otherwise it was too obvious ?So instead of using the CastTo keyword, replacing it with As is much much shorter keystrokes and comfortable to my eyes and brain.
Agreed!Yes, 'CastTo' sounds more complicated and may require some explanation of the inner workings. 'As' is more linguistic and natural. Good choice!
I agree (this time ).Ow, I like it! Very simple to read (and write)
I wish my national leaders would listen to the citizens voice before implementing a new law like what happened here. ?this forum and it's members are easily and simply the best on the internet
The first example reminds me of something I missed: typed lists.This reminds me
Dim lstButtons As New List(Of Button)
lstButtons(3).Text = "Something"
Buttons.Get(2).As(B4XView).Text = "abc"
Yes, 'CastTo' sounds more complicated and may require some explanation of the inner workings.
I never use CastTo in SQL but CAST AS or CONVERT.MSSQL
The first example reminds me of something I missed: typed lists.
With VB Net I could have:
and then I could have written:B4X:Dim lstButtons As New List(Of Button)
with this inline casting I will be able to do it:B4X:lstButtons(3).Text = "Something"
[Yes, I could use an array of Buttons but a List is not an array, it is much more powerful.]
I never use CastTo in SQL but CAST AS or CONVERT.
With VB Net I could have:
B4X:Dim lstButtons As New List(Of Button)
List<Button> lstButtons = New ArrayList<Button>