Dim Buttons As List = Array(Button1, Button2, Button3, Button4, Button5)
Dim btn As B4XView = Buttons.Get(1)
btn.Text = "boring"
Buttons.Get As B4XView(2).Text = "less boring"
Button5.Text = Buttons.Get As B4XView(2).Text
Dim m As Map = CreateMap("ttt": " 123 ;lkasd ")
Button4.Text = m.Get As String("ttt").Trim
Root.GetView As WebView(8).LoadURL("https://www.b4x.com") '8 is the view's index
A numbering in the designer would be very useful to find out faster the index of a view, with 20 views this is often exhausting.'8 is the view's index
Sub TicToc(Ob as object)
Ob as B4xView.Text = "try"
End sub
if Sub TicTac(Ob as object)
if Ob as B4xView.Text = "try" then log("ok")
End sub
if Sub TicTec(Ob as String)
if Ob as int = 12 then log("12")
End sub
Dim Buttons As List = Array(Button1, Button2, Button3, Button4, Button5)
Dim btn As B4XView = Buttons.Get(1)
btn.Text = "boring"
(Buttons.Get(2) As B4XView).Text = "less boring"
Button5.Text =(Buttons.Get(2) As B4XView).Text
Dim m As Map = CreateMap("ttt": " 123 ;lkasd ")
Button4.Text = m.Get As String("ttt").Trim
(Root.GetView(8) As WebView).LoadURL("https://www.b4x.com") '8 is the view's index
A numbering in the designer would be very useful to find out faster the index of a view, with 20 views this is often exhausting.
0
1
2
___0
___1
___2
3
4
Currently it can only be added after methods.Great!! Does it also affect non-indexed variables?
It isn't really related to this thread but it will be solved in one of the next versions.A numbering in the designer would be very useful to find out faster the index of a view, with 20 views this is often exhausting.
The next version of each IDE.On which version will it be available ( B4A/B4i/B4J?) ?
Wait, is this B4X version 2.0? ?B4X:Dim Buttons As List = Array(Button1, Button2, Button3, Button4, Button5) Dim btn As B4XView = Buttons.Get(1) btn.Text = "boring" Buttons.Get As B4XView(2).Text = "less boring" Button5.Text = Buttons.Get As B4XView(2).Text Dim m As Map = CreateMap("ttt": " 123 ;lkasd ") Button4.Text = m.Get As String("ttt").Trim Root.GetView As WebView(8).LoadURL("https://www.b4x.com") '8 is the view's index
Yeah, I also feel very confused by this new feature.Now, I am new to B4X. ?
I think the feature will make that a little easier and more readable:Yeah, I also feel very confused by this new feature.
xpnl_item_3.GetView(0).Color = BackgroundColor
xpnl_item_3.GetView(1).GetView(0).Text = Text
xpnl_item_3.GetView(1).GetView(1).GetView(0).Text = Amount & "€"
xpnl_item_3.GetView(1).GetView(1).GetView(0).Text = xpnl_item_3.GetView(1).GetView(1).GetView(0).Text.Replace(".",",")
xpnl_item_3.GetView(4).GetView(0).Text = GetItem3Count(CardType) +1
(Buttons.Get(2) As B4XView).Text = "less boring"
Dim m As Map = CreateMap("ttt": " 123 ;lkasd ")
Button4.Text = (m.Get("ttt")As String).Trim
Yes, I find it to be a big improvement.Personally, I find that the syntax suggested by @agraham is more readable
Yep, it should. And that's also a big improvement in my opinion.But, then, shouldn't it be
I'm not so sure, I'm really trying to like the syntax that Erel showed, but I'm not feeling it yet.Anyway, I'm sure that once we get used to this new feature we will love it
Agreed!Go B4X, go!
Yes, I missed that oneBut, then, shouldn't it be
Sub Class_Globals
Public Name As String
End Sub
Public Sub Initialize(mName as String)
Name = mName
End Sub
Dim lst as List
lst.Initialize
for i = 0 to 5
Dim cls as MyClass
cls.Initialize("Name" & i)
lst.Add(cls)
next
for i = 0 to lst.Size - 1
Log(lst.Get as MyClass(i).Name)
next
for i = 0 to lst.Size - 1
Log((MyClass)lst.Get(i).Name)
next
for i = 0 to lst.Size - 1
Log((lst.Get(i) As MyClass).Name)
next
for (var i = 0; i < lst.length; i++) {
console.log(lst[i]["Name"]);
}
yes.Would the 'concept' be equivalent to this (incorrect) code?
I like, nice alternative.Would the 'concept' be equivalent to this (incorrect) code?
It is such a special thing that it would be even better to use square brackets (although typing these is more cumbersome).I know you will have made up your mind and this might not fit your parser easily but I would find it more intuitive as
B4X:Dim Buttons As List = Array(Button1, Button2, Button3, Button4, Button5) Dim btn As B4XView = Buttons.Get(1) btn.Text = "boring" (Buttons.Get(2) As B4XView).Text = "less boring" Button5.Text =(Buttons.Get(2) As B4XView).Text Dim m As Map = CreateMap("ttt": " 123 ;lkasd ") Button4.Text = m.Get As String("ttt").Trim (Root.GetView(8) As WebView).LoadURL("https://www.b4x.com") '8 is the view's index
[Buttons.Get(2) As B4XView].Text = "less boring"
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?