I would like to copy a custom capacity variable as efficiently as possible, in one line preferably.
Code: Select all
VarSetCapacity(Var, 1024*3)
NumPut(1, Var, 0, "UInt")
NumPut(2, Var, 1024, "UInt")
NumPut(3, Var, 2048, "UInt")
;CopyOfVar := Var ;want something fast like this
;Instead I have been doing this which seems highly inefficient
VarSetCapacity(CopyOfVar, 1024*3)
NumPut( NumGet(Var, 0, "UInt") , CopyOfVar , 0 , "UInt" )
NumPut( NumGet(Var, 1024, "UInt") , CopyOfVar , 1024 , "UInt" )
NumPut( NumGet(Var, 2048, "UInt") , CopyOfVar , 2048 , "UInt" )
Thanks