473,379 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

creating vs. defining an array

3
I am getting the Error: Object reference not set to an instance of an object. for this code:

Class udtYear
Public N As Long 'total population size
...
End Class

Class udtRun
Public Yr(0 To PROJYR - MINYR) As udtYear 'year -1 of model simulation
End Class

Sub CrustaceanIBM()
...
Dim SimRun(0 To NumRuns - 1) As udtRun 'output of each simulation run
...
SimRun(r).Yr(0).N = N0

however I can't assign SimRun As NEW udtrun because SimRun is an array.

Any suggestions?

thanks
Amanda
Aug 15 '07 #1
1 1193
Killer42
8,435 Expert 8TB
Dim SimRun(0 To NumRuns - 1) As udtRun 'output of each simulation run
SimRun(r).Yr(0).N = N0
however I can't assign SimRun As NEW udtrun because SimRun is an array.

Any suggestions?
How about...
Set SimRun(0) = New udtRun
and similarly for each occurrence of the array?
(I have no idea whether this will work.)
Aug 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Pjotr Wedersteers | last post by:
Hello, I tried to create an array with 1000 cells, keys 0 thru 999 using $myarr = array (1000); But this leads to an array of 1 cell with value 1000; Now I have a workable solution for...
5
by: Xah Lee | last post by:
© # the following is a example of defining © # a function in Python. © © def fib(n): © """This prints n terms of a sequence © where each term is the sum of previous two, © starting...
7
by: Bob Rock | last post by:
Hello, this may seem a strange question, but is there a way of being able to call methods of a class through an array of that class when not referencing a specific object in the array. In other...
3
by: Raterus | last post by:
Very often while programming, I need to create a delimited string with various values. value1;value2;value3 Here is the problem I run into, and this isn't that big of deal, I always work around...
2
by: Helpful person | last post by:
I wish to access several pictures on my page by defining them as an array. This way I can either loop through them or access them by array index. I am a beginner at Javascript so please keep...
17
Motoma
by: Motoma | last post by:
This article is cross posted from my personal blog. You can find the original article, in all its splendor, at http://motomastyle.com/creating-a-mysql-data-abstraction-layer-in-php/. Introduction:...
2
by: nitinm | last post by:
hi I want to make a program whose requirement are as following: 1) it has to create an NxN matrix after reading input (i.e. N) from a file in the main() itself. 2) it has to send the array as...
9
by: Martin Racette | last post by:
Hi, I new to C#, and I would like to know how I can create an array that I do not know in advance how many item will be placed there -- Thank You in Advance Merci a l'avance Martin
5
numberwhun
by: numberwhun | last post by:
Ok, I have a ".csv" file that contains two lines (VERY LONG lines). Basically, the first line is the headers defining what each field in the second line is. ie: Name1,Name2,Name3,...........
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.