Solved

Array of objects

Posted on 2006-06-23
1
167 Views
Last Modified: 2010-04-23
Hi, can i do something like this?

In a module which i store all the global variables, i declare

public obj() as someClass

and on pageload based on a number generated.

for i = 0 to int_generated - 1
    obj(i) = new someClass
next

Thanks
0
Comment
Question by:jaxrpc
1 Comment
 
LVL 12

Accepted Solution

by:
omegaomega earned 500 total points
ID: 16966857
Hello, jaxrpc,

Yes, but you will need to re-dimension the array before you assign to it.  Use:

        ReDim obj(int_generated)
        For i As Integer = 0 To int_generated - 1
            obj(i) = New someClass
        Next i

Cheers,
Randy
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now