Android Question Passing CSBuilder

Scantech

Well-Known Member
Licensed User
How do you pass CSBuilder to another CSBuilder without loosing the Color properties?

For example
B4X:
    Dim Label1 As Label
    Label1.Initialize("")
   
    Dim CS1 As CSBuilder
    CS1.Initialize
   
    Dim CS2 As CSBuilder
    CS2.Initialize
   
    CS1.Color(Colors.Red).Pop.Append("Testing").Pop.Color(Colors.Blue).Pop.Append("CSBuilder").PopAll
    CS2 = CS1
   
    Label1.Text = CS2
 

Jeffrey Cameron

Well-Known Member
Licensed User
Did you try:
B4X:
Dim CS2 As CSBuilder
CS2.Initialize
CS2.Append(CS1)
I haven't tried it, but since the append method takes a char sequence I would assume this would work.
 

dagnabitboy

Active Member
Licensed User
You put a "Pop" right after adding colors.red and colors.blue, which effectively removes those colors.
I tested your idea and you can indeed equate CS2 = CS1.
Remove the extra pop as below and you'll be good to go.

B4X:
CS1.Color(Colors.Red).Append("Testing").Pop.Color(Colors.Blue).Append("CSBuilder").PopAll
 
Last edited:
Top