|
-
Jan 16th, 2000, 05:20 PM
#1
Thread Starter
Addicted Member
Is it possible to make a public array of TYPE.
example. I created the followin type and placed it inside a module.
Public Type CUsers
UserName As String
IP_Address As String
End Type
On a Form I tried the following :
Dim Students as Public CUsers
I got an error.
Is there a way to work around that?
------------------
OmarSwan
[email protected]
http://www.omarswan.cjb.net
To God Be The Glory
-
Jan 16th, 2000, 05:57 PM
#2
Frenzied Member
I thought the syntax for declaring a public variable like this was:
Public Students as CUsers
And I'm pretty certain you can make an array of a user-defined type. I've done it before.
-
Jan 16th, 2000, 06:04 PM
#3
Lively Member
Yes it is possible but check your declarations. It should read something like this.
Public Type CUsers
UserName As String
IP_Address As String
End Type
Then in a Module.
Global udtUsers() as CUsers.
or
Public udtUsers() as CUsers.
Now when you add items to the array use the redim preserve.
I hope this helps.
------------------
-----------------------
Maartin
[email protected]
-----------------------
-
Jan 16th, 2000, 10:51 PM
#4
Just remove the "Public" portion of your Dim when you want to use your user defined type, so the following works:
Dim Students as CUsers
------------------
Marty
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
|