Hi,
I have a complicated user-defined data type which includes numerous arrays, different variable types and so on, and I want to reset (erase) it so that all the numbers are back as 0, all the strings back as "" and so on.
I know I can do it like this:
Dim A as MyDataType
Dim B as MyDataType
' (Code here that populates variable A)
A = B
' (This resets A back to empty because B is empty)
However, my application is large and VB is unhappy with holding two of these variables in the same routine, in effect I can't spare the space to have an empty variable for resetting purposes.
VB doesn't allow Erase with a user-defined type, and I can't do A = Nothing, is there any other way of doing what I want?
- Andy.
I have a complicated user-defined data type which includes numerous arrays, different variable types and so on, and I want to reset (erase) it so that all the numbers are back as 0, all the strings back as "" and so on.
I know I can do it like this:
Dim A as MyDataType
Dim B as MyDataType
' (Code here that populates variable A)
A = B
' (This resets A back to empty because B is empty)
However, my application is large and VB is unhappy with holding two of these variables in the same routine, in effect I can't spare the space to have an empty variable for resetting purposes.
VB doesn't allow Erase with a user-defined type, and I can't do A = Nothing, is there any other way of doing what I want?
- Andy.