Hi, I have missing knowledge/a problem
Can I assign one variable of a user defined type to another of the same type?
Passing by value in a procedure does not compilet, but if I do this:
public type structtype
a as integer
b as integer
c() as string
cCount as long
end type
dim a as structype, b as structtype
with a
.a = 1
.b = 2
redim .c(1 to 3)
.c(1) = "works"
.c(2) = "really"
.c(3) = "well"
.cCount = 03
end with
a = b
If I run it like this, it compiles and ACTUALLY WORKS!!! B has all values of a, no reference. This is amazing, as it seems to be even possible to have dynamic array corretly transferred, even if these arrays are of user defined types.
BUT:
I have no idea what kind of damage this possibly could do, e.g. writin into memory areas that should be protected, you name it.
Does anyone know if this "working" is a bug or if this is acutally correct?
Thanks a lot
Wolow
Can I assign one variable of a user defined type to another of the same type?
Passing by value in a procedure does not compilet, but if I do this:
public type structtype
a as integer
b as integer
c() as string
cCount as long
end type
dim a as structype, b as structtype
with a
.a = 1
.b = 2
redim .c(1 to 3)
.c(1) = "works"
.c(2) = "really"
.c(3) = "well"
.cCount = 03
end with
a = b
If I run it like this, it compiles and ACTUALLY WORKS!!! B has all values of a, no reference. This is amazing, as it seems to be even possible to have dynamic array corretly transferred, even if these arrays are of user defined types.
BUT:
I have no idea what kind of damage this possibly could do, e.g. writin into memory areas that should be protected, you name it.
Does anyone know if this "working" is a bug or if this is acutally correct?
Thanks a lot
Wolow