473,387 Members | 1,890 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,387 software developers and data experts.

dynamic array question???

Hi the below code works fine.

however as i wont always know that the objloc array has 4
parameters...how can i modify this code so that the array is dynamic??

Sub MapSelectedProperties()
Dim objLoc2(1 to 4) As MapPoint.Location
Dim i As Integer
i = 0
Set Recordset = CurrentDb.OpenRecordset("SELECT * FROM
tblProperties;")
If Recordset.RecordCount 0 Then
While Not Recordset.EOF
i = i + 1
Set objLoc2(i) =
objMap.FindAddressResults(Recordset!strStreet, Recordset!strCity,
Recordset!strState, Recordset!strPostalCode)(1)
Set objPin = objMap.AddPushpin(objLoc2(i), Recordset!strStreet)
Recordset.MoveNext
Wend
End If
' objMap.Shapes.AddPolyline objLoc2

Dec 14 '06 #1
2 1051
Hi marc,

you could use for instance

dim objLoc2 as New arraylist

dim objLoc2 as New List(Of MapPoint.Location)
[Imports System.Collections.Generic]

or similar
....
Marc ha scritto:
Hi the below code works fine.

however as i wont always know that the objloc array has 4
parameters...how can i modify this code so that the array is dynamic??

Sub MapSelectedProperties()
Dim objLoc2(1 to 4) As MapPoint.Location
Dim i As Integer
i = 0
Set Recordset = CurrentDb.OpenRecordset("SELECT * FROM
tblProperties;")
If Recordset.RecordCount 0 Then
While Not Recordset.EOF
i = i + 1
Set objLoc2(i) =
objMap.FindAddressResults(Recordset!strStreet, Recordset!strCity,
Recordset!strState, Recordset!strPostalCode)(1)
Set objPin = objMap.AddPushpin(objLoc2(i), Recordset!strStreet)
Recordset.MoveNext
Wend
End If
' objMap.Shapes.AddPolyline objLoc2
Dec 14 '06 #2
thanks tommaso,

ive think im in the wrong forum....this is all access vba..i dont think
it suppports array lists?
to**************@uniroma1.it wrote:
Hi marc,

you could use for instance

dim objLoc2 as New arraylist

dim objLoc2 as New List(Of MapPoint.Location)
[Imports System.Collections.Generic]

or similar
...
Marc ha scritto:
Hi the below code works fine.

however as i wont always know that the objloc array has 4
parameters...how can i modify this code so that the array is dynamic??

Sub MapSelectedProperties()
Dim objLoc2(1 to 4) As MapPoint.Location
Dim i As Integer
i = 0
Set Recordset = CurrentDb.OpenRecordset("SELECT * FROM
tblProperties;")
If Recordset.RecordCount 0 Then
While Not Recordset.EOF
i = i + 1
Set objLoc2(i) =
objMap.FindAddressResults(Recordset!strStreet, Recordset!strCity,
Recordset!strState, Recordset!strPostalCode)(1)
Set objPin = objMap.AddPushpin(objLoc2(i), Recordset!strStreet)
Recordset.MoveNext
Wend
End If
' objMap.Shapes.AddPolyline objLoc2
Dec 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Vasileios Zografos | last post by:
Hello, I have a function that generates some values (e.g. vertices in 2d space) the number of which I dont know. So, it could generate 20 vertices, 100 vertices, or even 1 vertex. void...
1
by: AMT2K5 | last post by:
Hello folks. I am at the chapter in my textbook towards learning about dynamic memory and am practicing with a few examples and lessons from a variety of places. I am confused about one certain...
8
by: Peter B. Steiger | last post by:
The latest project in my ongoing quest to evolve my brain from Pascal to C is a simple word game that involves stringing together random lists of words. In the Pascal version the whole array was...
4
by: Saul775 | last post by:
Hello, all: Just a general question that's been bothering me. Suppose I'd like to create a 2D array of integers -- not using the vector template -- but I need to dynamically create the array as...
1
by: None | last post by:
Dynamic array creation Hi all... here's a good one for you... I have a situation where I have some bean, and I need to populate an array field in it... here's the problem... I do not know the...
1
by: Skyer | last post by:
How to write? I have write program in C language. This program contain 1 array with struct. Every element of table must be dynamic list LIFO (stack). Adding and removing struct variable from...
0
by: pjr | last post by:
Using VS2005, I dynamically create an event delegate. Code follows question. My method gets the event's parameters and passes them onto a common event handler. My delegate gets called when expected...
24
by: VijaKhara | last post by:
hi all, i am trying to create a dynamic 2D array with size N x 3 (N will be put in as a parameter) using the following code: int **xyz; int i,N; N=30000; xyz=malloc(3*sizeof(int*));
0
by: Eniac | last post by:
Hi, I've been working on a custom user control that needs to be modified and the validation is causing me headaches. The control used to generate a table of 4 rows x 7 columns to display all...
11
by: C C++ C++ | last post by:
Hi all, got this interview question please respond. How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Rgrds MA
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.