Wish WITH and END WITH structure

vbmundo

Well-Known Member
Licensed User
Hi,

I wish that B4A include in future versions the

WITH <Object>


END WITH

Structure.

Because this structure help to keep a clear code and you write less words..

NOW
B4X:
    ListaCheques.TwoLinesLayout.SecondLabel.TextColor=Colors.RGB(44,62,80)
    ListaCheques.TwoLinesLayout.SecondLabel.Gravity=Gravity.CENTER_VERTICAL
    ListaCheques.TwoLinesLayout.SecondLabel.Height=50dip
    ListaCheques.TwoLinesLayout.SecondLabel.Top=50dip
    ListaCheques.TwoLinesLayout.SecondLabel.Width=74%x
    ListaCheques.TwoLinesLayout.SecondLabel.Left=97dip

WITH - END WITH

B4X:
    With  ListaCheques.TwoLinesLayout.SecondLabel
             .TextColor=Colors.RGB(44,62,80)
             .Gravity=Gravity.CENTER_VERTICAL
             .Height=50dip
             .Top=50dip
             .Width=74%x
             .Left=97dip
    End With

Thanks
 

vbmundo

Well-Known Member
Licensed User
You can write it like this:
B4X:
Dim lbl As Label = ListaCheques.TwoLinesLayout.SecondLabel
lbl.Gravity = ...
lbl.Height = ...
lbl.Top = ...

Just a question

When you modify the lbl properties, this new values modify ListaCheques.TwoLinesLayout.SecondLabel ?
 
Top