I thought I could copy a structure with a() = b() but it seems only the pointer to a() is set to b()
A sample with two modules to illustrate:
Module A
Module B
After the aType(0).A = "C" in module B, the value of main.aType(0).A also becomes "C"
aType in Module A is declared public. aType in Module B is only ment to exist in module B
So is it possible to copy a structure?
A sample with two modules to illustrate:
Module A
B4X:
Sub Globals
Public Type (A, B, C) aType(0)
End Sub
Sub App_Start
form1.Show
aType() = Array(("A", "B", "C"))
initThis
End Sub
Public Sub initThis
Button1.Text = aType(0).A
End Sub
Sub Button1_Click
aForm.initThis
End Sub
Module B
Sub Globals
Dim Type (A, B, C) aType(0)
End Sub
Public Sub initThis
aForm1.Show
aType() = main.aType()
aType(0).A = "C"
aButton1.Text = aType(0).A
aForm1.Show
End Sub
Sub aButton1_Click
aForm1.Close
main.initThis
End Sub
After the aType(0).A = "C" in module B, the value of main.aType(0).A also becomes "C"
aType in Module A is declared public. aType in Module B is only ment to exist in module B
So is it possible to copy a structure?