Class Detection and Selection

Started by
2 comments, last by PREDATOR_UK 12 years, 10 months ago
OK so i'm working on a programming project and for it I have to use a custom class,

After an object of the class has been created it needs to be added to something like an array where I can access it and get its personalized properties back

Is this possible ?

Thanks
AMD Phenom II X6 1090T 3.2GHz
XFX ATI Radeon 5770 1GB GDDR5
ASUS M4A89GTD Pro USB 3.0
CORSAIR XMS3 4GB 1600MHz
THERMALTAKE V3
SEAGATE 500GB
WINDOWS 7 ULTIMATE 64 Bit
Advertisement
What languege are you using? Of course this is possible, but it really depends on the languege. In C++ for example you could use std::vector or std::map to achieve this.
VB.NET
AMD Phenom II X6 1090T 3.2GHz
XFX ATI Radeon 5770 1GB GDDR5
ASUS M4A89GTD Pro USB 3.0
CORSAIR XMS3 4GB 1600MHz
THERMALTAKE V3
SEAGATE 500GB
WINDOWS 7 ULTIMATE 64 Bit
Ok after some research I found some stuff out so I thought I would share it:

Say banana is your custom class.

Dim bananasgroup(10) as banana
banana(0).juicy = 1
banana(3).juicy = 3

Then to save this array...

For each i as new banana in bananasgroup
Save(i.juicy)
next i

Where save is your function, hope this clears some stuff up, it certainly did for me :)
AMD Phenom II X6 1090T 3.2GHz
XFX ATI Radeon 5770 1GB GDDR5
ASUS M4A89GTD Pro USB 3.0
CORSAIR XMS3 4GB 1600MHz
THERMALTAKE V3
SEAGATE 500GB
WINDOWS 7 ULTIMATE 64 Bit

This topic is closed to new replies.

Advertisement