table of a type made by user

asked 2016-06-10 15:28:35 +0100

latnahc gravatar image

I want to build a table in which I memorise date of a type I've created

Here is an example

Type t_test nom as String numero as Integer End Type

Sub test() Dim tab_individus(3) As t_test Dim individu as t_test

individu.nom = "a"
individu.numero = "1"
tab_individus(0) = individu

individu.nom = "b"
individu.numero = "b"
tab_individus(1) = individu

individu = tab_individus(0)
print "en 0 : " & individu.nom & individu.numero
individu = tab_individus(1)
print "en 1 : " & individu.nom & individu.numero

End Sub

it should print en 0 : a0 en 1 : b1 but it prints en 0 : b1 en 1 : b1

How could I fix this problem ?

edit retag flag offensive close merge delete