• Welcome to Valhalla Legends Archive.
 

Vb Question

Started by Atom, February 24, 2003, 02:49 AM

Previous topic - Next topic

Atom

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.
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

Grok

#1
Public MyArray() As String

Spht

#2
Quotelol....

What's the point in replying just to laugh? Ideally you'd keep that to yourself.

Atom

how is that an array of a public type? thats an array of a string...
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

Etheran

#4
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.

Atom

#5
you know thats not what i meant, u can make your own types in vb, but forget it
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

Etheran

Well, how Grok explained it is how you would do it I imagine.

Public MyArray() as MyType

Grok

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.

iago

#8
Can you do Unions in vb?
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Yoni

#9
QuoteCan you do Unions in vb?
Of course not! What, you think VB gives users any control over the variables' placement in memory?

Atom

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)
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

Banana fanna fo fanna

#11
Haze:

You are not allowed to laugh at other people's questions.