Solved

Array of objects

Posted on 2006-06-23
1
188 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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