What I expect: to clone a copy of csb1 data to csb2 and csb1 should remain unchanged regardless of whatever I change to csb2.
What I've got so far: csb1 and csb2 are the same.
Could someone show me how to achieve what I want, please?
TIA
What I've got so far: csb1 and csb2 are the same.
Could someone show me how to achieve what I want, please?
B4X:
Dim csb1 As CSBuilder
csb1.Initialize
csb1.color(xui.color_blue).Append("Tigers are big. ").pop
Dim csb2 As CSBuilder=csb1 'get a copy of csb1
csb2.Append(" They live in the wild.")
'The output of following two lines are identical: Tigers are big. They live in the wild.
Log(csb1) 'it should output: Tigers are big.
Log(csb2)
TIA
Last edited: