-
Oct 13th, 2000, 08:49 AM
#1
Thread Starter
Lively Member
I have defined many UDT's in my project as Public becase they are used throughout. I have a reset button on the main form but when this is clicked i dont want to do the following:-
UDT1.String1 = ""
UDT1.Int1 = 0
UDT2.String1 = ""
UDT2.Long1 = 0
it's too much of a long proccess, so what i want to do is reset it by using just the name of the UDT, e.g.
UDT1 = Nothing (obviously this doesn't work thought)
Any help would be appreciated
P.S I cant set UDT's to PRIVATE because they are used in many forms.
-
Oct 13th, 2000, 08:59 AM
#2
This is the perfect case for ZeroMemory.
Code:
'In a module
Public Declare Sub ZeroMemory Lib "kernel32" Alias "RtlZeroMemory" (pDest As Any, ByVal cbZero As Long)
Public Sub ResetUDT(MyUDT)
ZeroMemory MyUDT, Len(MyUDT)
End Sub
Usage:
Code:
ResetUDT AnyUDTComesHere
Good luck!
-
Oct 16th, 2000, 05:02 AM
#3
Thread Starter
Lively Member
How did i know it would be an API
I knew it would be an API somehow
Thanks for the help
much appreciated (if that is hoe you spell it)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|