Is there any way that I can make an Array of a Public Type?
If i could it would make my project a lot easier. Code Plz.
Public MyArray() As String
Quotelol....
What's the point in replying just to laugh? Ideally you'd keep that to yourself.
how is that an array of a public type? thats an array of a string...
Quotehow is that an array of a public type? thats an array of a string...
A string is a type, therefore, a public string is a public type.
you know thats not what i meant, u can make your own types in vb, but forget it
Well, how Grok explained it is how you would do it I imagine.
Public MyArray() as MyType
Well there's Enums and Types...
Public Enum STATE_CODE
AK
AL
GA
FL
'etc
End Enum
Public Type MyNewType
FirstName As String
LastName As String
Address1 As String
Address2 As String
State as STATE_CODE
End Type
Public Locator() As MyNewType 'array of custom public type
Sub Main
ReDim Locator(0 to 0)
Locator(0).FirstName = "Atom"
Locator(0).LastName = "Ant"
Locator(0).Address1 = "123 Anystreet"
Locator(0).State = FL
End Sub
Any questions, just ask.
Can you do Unions in vb?
QuoteCan you do Unions in vb?
Of course not! What, you think VB gives users any control over the variables' placement in memory?
ahhh see my problem was that i was thinking, that if i did that i would be declaring the variable twice, when actually the first time i was declaring the type and not the variable, thanks grok 8)
Haze:
You are not allowed to laugh at other people's questions.