Hi,
I'm new to PureBasic and i'm trying to see it's possible to copy an index to another of a structure.
Structure misc1
NetId.l
Buffer.s
IP.s
Steps.b
EndStructure
Dim Client.misc1(20)
Lets say i want to copy index #1 of Client to Index #2.
In Visual Basic you can do Client(2)=Client(1) but it doesn't work in PB :>
Is it possible or I would have to copy every elements from an index to another?
Thanks
Structures
Sorry, but for now you'll have to copy each element separately, but if you have a structure without any strings in it you could do it like this:
Code: Select all
...
Dim Client.MyStruct(20)
...
CopyMemory(@Client(#Index1), @Client(#Index2), SizeOf(MyStruct))
; this will copy the content of #index1 to #Index2

