Can someone gave me some tips about faq222-607 (ping in vbasic). I'm having serious trouble using it. I already asked a question about this. (thread222-105415 really would appreciate some help on this matter.
Thanks in advance
Sander
Hi,
Maybe I was not clear enough.
I tried to move types but I keep on getting errors. I don't know very much about user defined types (it's a whole new part of VB to me, module classes aren't my thing to yet). Normally if I try to do something and I don't know were to start, a piece of sample code mostly gives me an indication where to begin. On this one, I have not a single clou how to proceed so a working example would be nice.
public type MyRecord
myname as string
myage as integer
myIsMale as boolean
end type
public means you can use a definition in other modules.
Although, for some reason, you are not allowed to have Public Types in Form Modules or Class Modules. So what i do is make the Type private. This means it can only be accessed in the module it was created in.
Heres an example of a Private Type:
private type MyRecord
myname as string
myage as integer
myIsMale as boolean
end type
Also, with types you can do this:
Private Sub MySub (TheRecord As MyRecord)
'( because the type is private)
but you cannot do this:
Public Sub MySub (TheRecord As MyRecord)
' ( because the type is public)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.