|
-
Feb 18th, 2002, 02:12 PM
#1
Thread Starter
Lively Member
made up properties for objects
I am making an RPG and need some help.
I set up the characters like this:
Global Char(1 to 5) as new Char
with Char being a new class module. I would like to put some properties in the class module so that i could do something like this in my main form:
Char(1).Item1="Sword"
Char(1).Name="Bush"
anyone know how i might do this?
Often talked of, never seen,
Ever coming, never been,
Daily looked for, never here,
Still approaching, coming near,
Thousands for its visit wait,
But alas for their fate,
Tho' they expect me to appear,
They will never find me here.
What's this about?
-
Feb 18th, 2002, 03:49 PM
#2
Good Ol' Platypus
Use the Visual Basic Class Builder. Alternatively, if you're only using the properties and not methods or events, you'll also want to look into Types (they're faster).
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Feb 19th, 2002, 12:35 AM
#3
Addicted Member
Its much easier to use your own User defined type...
Type [put type name here, such as RPGChar]
Item1 as String
Name as String
End Type
then u can use it like this:
Public MyRGBChar as RGBChar
Command1_Click()
MyRGBChar.Name = "Bush"
... and so on
you can also try putting and array of strings in you user defined type (like
Item(1 to 5) as string
would give you 5 'Items' variables
Hope this helps....
To protect time is to protect everything...
-
Feb 19th, 2002, 02:54 PM
#4
Thread Starter
Lively Member
Thanks alot. This helped me an enormous amount
Often talked of, never seen,
Ever coming, never been,
Daily looked for, never here,
Still approaching, coming near,
Thousands for its visit wait,
But alas for their fate,
Tho' they expect me to appear,
They will never find me here.
What's this about?
-
Feb 19th, 2002, 04:26 PM
#5
Addicted Member
To protect time is to protect everything...
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
|