Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




VBA Excel 'get' UDT Dynamic Array From File


Hi

I can retrieve an array of one dimension using variant declaration in code elsewhere in this project, but can not get it to work (error 'bad record lenght') with this 2 dimensional UDT array ("i: rends" is saved earlier on in the project as a Trendline UDT in the form of a 2 dimensional dynamic array). BTW no problems using statement 'put' to file obviously.


Code:
Type Trend_Line 'declared in another module within same workbook
Gradient As Double
Price As Double
'today's current trendline price
breach As Boolean
'true if trendline has been breached by prices
EndDay As Integer
'last day of trend forming point (youngest day of trend)
StartDay As Integer
'first day of trend (oldest day of trend)
End Type

function a
Dim array2() As Trendline 'will become 2 dimensional UDT array


Open ("i: rends") For Random As #1 Len = FileLen("i: rends")Get #1, , array2
Close #1
.....more code



edn function a

can someone help me please load this file using get statement.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Output An Dynamic Array In To Excel
I am a graduate student in transportation
I am using an excel macro to handle the output processing of a tsd /binary file using an object reader.Now with the dynamic array I have written below(unknown rows,21 columns) how can I output it to excel.

Please help.I am a newcomer to this..

let me know if my array cod eis wrong as well as unless I output this stuff in to excel I cant read it as the file I am reading is a binary file.

Code:
' begin the loop for set of actions to perform for each vehicle counted on current link
For j = 0 To tsdLink.LinkVehCount - 1
'Redimension the dynamic array
ReDim vehArray(0 To tsdLink.LinkVehCount - 1, 1 To 21)

'Begin populating array with vehicle data by looping on vehicle
For nVeh = 0 To tsdLink.LinkVehCount - 1

'Each vehicle is now referenced using the method tsdLink.linkVehicles(nveh)
Set veh = tsdLink.linkVehicles(nVeh)
vehArray(nVeh, 1) = Time
vehArray(r, 2) = up
vehArray(r, 3) = dn
For nCol = 1 To 18
vehArray(nVeh, nCol + 3) = veh.Vehfields(nCol)
Next
Next

Excel Subtotal - Dynamic Array
Hello,

I'm writing an application that transfers data to a spreadsheet. I need to make subtotals in the spreadsheet with dynamic array's.
Example : the array can be all combinations from 1 to 9 :
array(1, 5, 7, 8, 9)
array(2, 3, 4, 5)
...
I tried to pass an array to the subtotal function of the type variant, that does not work.
I also tried to pass a variant containing the dynamic array : "array(1, 5, 8)", that does not work either.
Anyone an idea how to solve this problem ?

Thanks !

Dimensionalized Dynamic Array Copied To A New Array Is No Longer Dynamic
I have a user-defined object DS, with a child used-defined object l() which is a dynamic array.

At some stage, I ReDim DS.l(x) where x is any positive integer and use the array.

I later do Let tempDS = DS and try to use the tempDS object and its property .l() in the same way. I'm trying to subsequently ReDim tempDS.l(y) ... but it doesn't work because the tempDS.l object was created as tempDS.l(x), not tempDS.l()

How can I make tempDS.l be created as l() and not l(x) when created by copying DS.l(x) ?

Searching A Text File Using A Dynamic Array
Hi All,

I have been working on this problem for a few days but am no nearer a resolution. Before I go into detail, I would like to preface by saying that I am aware that a database application would work much better than what I am trying to do.

I am trying to create a form that will allow a user to input an area code and 7-digit telephone number. The app will take that telephone number and query a text file (.csv) to determine if a match to that number resides within the file.

I have been able to create a simple code to read the file and return numbers off of the list in sequence. What I need is for my code to read all numbers and only return the one that matches the user input if it exists. I have set up an array that will pick up multiple numbers based on the subscript. However, I need the subscript to be dynamic as records within the text file will be changing all the time. Furthermore, I need the subscript to be able to accomodate a large number of strings as the text file will contain between 600,000 to close to 1,000,000 phone numbers.

I have been researching examples of dynamic arrays on this forum for hours, but I just do not quite understand how they work. Any advice anyone can offer would be greatly appreciated.

Read/Write A Dynamic Array To/from A .dat File
I am not too good with VB, but can someone help me with writing a dynamic array, of say Contacts, ie. address, telephone no., etc, to a .dat file and then being able to read it again.

I have seen this somewhere before, and I think I need to be able to write the current record and total record count at the top of the .dat file too.

Thanks!!

Read/Writing A Dynamic Array To/from A .dat File
Hello


I am not too good with VB, but can someone help me with writing a dynamic array, of say Contacts, ie. address, telephone no., etc, to a .dat file and then being able to read it again.

I have seen this somewhere before, and I think I need to be able to write the current record and total record count at the top of the .dat file too.

Thanks!!

Reading Dynamic Array From Binary File.
Hey, I've some subscript out of range error in my coding.
Can anyone help? or explain why?


Code:
Option Explicit
Option Base 1

Private Type Map_UDT1
Rec As Long
Pts As Long
End Type
Private MapInfo As Map_UDT1

Private Type Map_POINT
x As Single
y As Single
End Type

Private Type Map_UDT2
Data() As Map_POINT
End Type
Private MapPoint As Map_UDT2

Private Sub SaveFile()
Dim i As Long
Dim p As Long

If Dir(App.Path & "map.tbl") <> "" Then Kill App.Path & "map.tbl"
If Dir(App.Path & "map.dat") <> "" Then Kill App.Path & "map.dat"

For i = 1 to 10
MapInfo.Rec = i
MapInfo.Pts = Int(Rnd * 10) + 1

'Save data into the Reference file
Open App.Path & "map.tbl" For Binary As #1 Len = Len(MapInfo)
Put #1, LOF(1) + 1, MapInfo
Close #1

ReDim MapPoint.Data(MapInfo.Pts)
Randomize Timer
For p = 1 To MapInfo.Pts
MapPoint.Data(p).x = (Rnd * 101) + 100
MapPoint.Data(p).y = (Rnd * 3.1) + 3
Next

'Save data into the points data file
Open App.Path & "map.dat" For Binary As #1 Len = Len(MapPoint)
Put #1, LOF(1) + 1, MapPoint
Close #1
Next
End Sub

Private Sub ReadFile()
Dim Ptr1 As Long
Dim Ptr2
Dim p As Long
Dim str As String

If Dir(App.Path & "map.tbl") = "" Then
MsgBox "Missing table file."
Exit Sub
End If

If Dir(App.Path & "map.dat") = "" Then
MsgBox "Missing data file."
Exit Sub
End If

Ptr1 = 1
Ptr2 = 1
Open App.Path & "map.tbl" For Binary As #1 Len = Len(MapInfo)
While Not EOF(1)
Get #1, Ptr1, MapInfo

If MapInfo.Pts > 0 Then
ReDim MapPoint.Data(MapInfo.Pts)
Open App.Path & "map.dat" For Binary As #2 Len = Len(MapPoint)
Get #1, Ptr2, MapPoint
Close #2

'Update File Pointer
Ptr2 = (Len(MapPoint) * Ptr2) + 1

For p = 1 To MapInfo.Pts
'Why I hit the Subscript Out Of Range Error over here?
'I did declare the MapPoint.Data array before I open the file.
str = str & MapPoint.Data(p).x & ", " & MapPoint.Data(p).y & vbCrLf
Next
End If

Debug.Print str

'Update File Pointer
Ptr1 = (Len(MapInfo) * MapInfo.Rec) + 1
Wend
Close #1
End Sub



[Edited by Chris on 01-17-2001 at 02:57 AM]

Random Access File Problem On Dynamic Array....
hello,
I am working with VB code. when I access data from random file access using dynamic array, i got "out of memory" error:7 on "get" statement. it happen with perticular file and not with testing or sample file. on static array work fine. can any one tell what is problem with my file which are already written by GWBasic code. Also one thing I observe if some spaces at start it gives error but if remove these spaces it work partially means read the data some extent not all.

Any other data type size possible to define dynamically(or with "Type" or any how). any other way to reslove this problem. I posting some code please help to resolve this error. Thanks


VB Code:
Dim FD71, FD72 As IntegerDim temp() As String * 1, temp11() As String * 1, i, temp1 As IntegerDim tempstr, tempstr1 As String temp1 = 4096ReDim  temp(1 To temp1) As String * 1temp1 = 4100ReDim temp11(1 To temp1) As String * 1 FD71 = FreeFile    Open "C: emp1.txt" For Random Access Read Write As #FD71 Len = 4150FD72 = FreeFile    Open "c: emp111.txt" For Random Access Read Write As #FD72 Len = 4152 Get #FD71, , temp               '<- this get statement gives errortemp11 = tempPut #FD72, , temp11    Close FD71Close FD72

Redim A Dynamic Array As A Dynamic Array
How can I redim a dynamic array as a dynamic array??



dim h()

some loop function

h() = split(string, chr(0))

redim h()

next

Excel File =&gt; Array
does anyone know how to save the entire contents of an excel file into an array withou reading the file line by line
regards
jcd

Control Array && Dynamic Array
OK ... I know I should know this, and probably do, but I am banging my head on my keyboard right now.
I need to store in a Dynamic array the Index of each changed textbox that is a control array. So if the user changes boxes 1,3 & 14, only those would be stored in the array. Obviously I would need to gather this info. in the textbox change event, and use reDim preserve keywords, but an hour of trying has only gotten me error messages!
Any help?
Thanks
Michael

Dynamic Array Fun
Hi

Im trying to write a sub that creates an array named monday if the value in one column of boolean results is true. The trouble is I don't know how entries i'll have. Here is the code I tried that gets a "Sub script out of range error on the line with the redim statement.


Code:
Sub Monday()
Dim rc As Long, Mon() As Variant
Dim rng As Range, cell As Range
Dim i As Long

rc = Cells(Rows.Count, 2).End(xlUp).Row
Set rng = Range(Cells(4, 2), Cells(rc, 2))
For Each cell In rng
If cell.Value = True Then
ReDim Preserve Mon(LBound(Mon) + 1, 18)
Mon(LBound(Mon) + 1, 1) = cell.Offset(0, -1).Value
For i = 2 To 18
Mon(LBound(Mon) + 1, i) = cell.Offset(0, i + 6)
Next i
End If
Next cell
End Sub

Dynamic Array Fun
Hi,

I'm havin issues getting an array to work. I need to use an array because i think it will make some projects I have easier. The issue is I don't really know how. In this example I have a worksheet that two columns of information I want to add to an array.

Here is the code I'm tying:


Code:
Sub ARRAY2D()
Dim Arr() As Variant
Dim rw As Single
Dim cw As Single
Dim i As Single
Dim j As Single

If Cells(Rows.Count, 1).End(xlUp).Row > Cells(Rows.Count, 2).End(xlUp).Row Then
rw = Cells(Rows.Count, 1).End(xlUp).Row
Else
Cells(Rows.Count, 2).End(xlUp).Row
End If

If Cells(1, Columns.Count).End(xlToLeft).Column > Cells(1, Columns.Count).End(xlToLeft).Column Then
cw = Cells(1, Columns.Count).End(xlToLeft).Column
Else
cw = Cells(2, Columns.Count).End(xlToLeft).Column
End If

For i = 1 To rw
For j = 1 To cw
ReDim Preserve Arr(1 To i, 1 To j)
Arr(i, j) = Cells(i, j).Value
Next j
Next i

MsgBox WorksheetFunction.CountA(Arr)

End Sub

When I run it the Redim line is hightlighted and I get the subscript out of range message.

If I take out the "Preserve" my message box in the in returns a big fat zero, which is not right

Help?

UDT And Dynamic Array
I want to set up a UDT that would look something like:

Quad(1 to 4).Wall(1 to 5).Points(0 to n).X
Quad(1 to 4).Wall(1 to 5).Points(0 to n).Y
Quad(1 to 4).Wall(1 to 5).Points(0 to n).Z

where n = 10 when .Wall(1)
where n = 13 when .Wall(2)
where n = 15 when .Wall(3)
where n = 13 when .Wall(4)
where n = 9 when .Wall(5)

Is this possible? What would the Type statements look like?

Dynamic Array
How can I define a dynamic array? Im going to work with an undetermined number of strings...

How Do You Do A Dynamic 2d Array?
Heres a test code I tried

Code:
Option Explicit
Private sData(1 To 2, 1 To 2) As String

Private Sub cAdd_Click()
ReDim Preserve sData(1 To 2, 1 To 3)
sData(2, 3) = "hi"
MsgBox sData
End Sub

What I wanted to do was increase the rows in that array, but I get an error saying the array is already dimensioned.

Dynamic Array?
Ok Im new to visual Basic, but I am curious about 2 things.

1) can i make objects using class modules?

and

2) if i create an array, if it possible to get its length for a loop of some type.
like the java arrayname.length?

Help Me With Dynamic Array
I have downloaded this great script for my very simple shoppingcart page, but I need it to delete from the list as well.

Can someone make a method for the class that erases an element from the list, please?


Code:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This class serves as a growable dynamic array.
'
' Author: Leo Shuster
' Date Created: 11/17/1998
' Last Changed:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Option Explicit

' Class Constants
Const INITIAL_SIZE = 10 ' Initial size of the array

' Class variables
Private mElements As Integer
Private mStrArray() As String


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Class Initialization and Destruction Methods
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Allocate initial amount of memory to the array
Private Sub Class_Initialize()
ReDim Preserve mStrArray(INITIAL_SIZE)
End Sub

' Deallocate the entire array
Private Sub Class_Terminate()
Clear
End Sub


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Class Properties
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Return the current array size
Public Property Get Size() As Long
Size = UBound(mStrArray)
End Property

' Return current amount of elements in the array
Public Property Get Count() As Long
Count = mElements
End Property

' Return the value found at the specified location
Public Property Get Item(index As Integer) As String
If index < Size() Then
Item = mStrArray(index)
End If
End Property

' Assign a new value to the specified item
Public Property Let Item(index As Integer, newValue As String)
If index < Size() Then
mStrArray(index) = newValue
If index >= mElements Then mElements = index + 1
End If
End Property


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Class Methods
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Add a new item to the array
Public Sub Add(newValue As String)
' Check the size of the array
Resize

' Add the value at the next index
mStrArray(mElements) = newValue
mElements = mElements + 1
End Sub

' Add a new item to the array only if it doesn't already exist
Public Sub AddNew(newValue As String)

If Find(newValue) >= 0 Then
Exit Sub
Else
Add newValue
End If
End Sub

' Resize the array to fit more items
Private Sub Resize()
Dim arraySize As Long
arraySize = Size()
If Count() = arraySize Then
ReDim Preserve mStrArray(arraySize + INITIAL_SIZE)
End If
End Sub

' Erase the array
Public Sub Clear()
Erase mStrArray
mElements = 0
End Sub

' Find the specified item in the list;
' return its index if found, -1 otherwise
Public Function Find(strItem As String) As Integer
' Find the specified item
Dim i As Integer
For i = 0 To Count - 1
If Item(i) = strItem Then
Find = i
Exit Function
End If
Next

' No match was found -- return -1
Find = -1
End Function

' Display contents of the list on the screen
Public Function Display()
Dim i As Integer, str As String
For i = 0 To Count - 1
str = str & Item(i) & ","
Next
Display = str
End Function

Dynamic Array
is there a way to tell if a dynamic arrays demensions havent been set i ask this cause im making an array that just gets 1 element bigger each time the user adds a item

redim intarray(0 to ubound(intarray) + 1)

that works for making it go up one but the problem is that the array starts out with no elements so the ubound function causes an error

so how would i make it work a different way or how would i find out if its not initialized so i could just do

if array isnt initialized then
redim intarray(0 to 0)
else
redim intarray(0 to ubound(intarray) + 1)
endif

Dynamic Array
Hi all, how do I declare and use dynamic array? please help.

ss

Dynamic Array
Hi folks! You guys are great! It's like having an Encyclopaedia VBritanica on hand!

I got a question:

How do I create dynamic arrays? I need to create a 10x10 array and fill it up with values. I don't know before hand how many of these arrays I need to create.

I read up documentation on using classes and creating objects dynamically. I understand that. But I don't understand how to put arrays in classes and how to manipulate these arrays.

-xmen64

Dynamic Array
I want to make a 2 dimensional array. One of the values will be size 8 but the other should be dynamic. Is there a way i can do this? The reason i wanna do this is because i do not want allocate a large amount of memory and possibly not even use it. If there is no way of declaring a 2 dimensional array dynamically what is the maximum value that i can put in?

Dynamic Array??
How to declare and use a dynamic array? What I want is that the size of the array will be determine at run-time according to the demand..

Thanks for anyone who help....

Dynamic Str Array -&gt; Dynamic Int Array
is it possible to convert a dynamic string array to a dynamic integer array? i keep getting "cant assign to array" errors. do i have to set up a loop and convert each element individually?

Dynamic Array
I have a dynamic array that is created throughout the program, but now i need to do a loop based on the amount of items in the array is there a way i can see how many items there are in it, rather than creating a counter and adding one to it every time i redim the array???

Dynamic Array
Hello,
I would need to have a dynamic array:
MyArray() as Integer

During program excetution I would need to add items to this array:

ReDim Preserve MyArray(LBound(MyArray) to UBound(MyArray))
MyArray(UBound)= x


this does not seem to work.

How do I delete an item?

Dynamic Array Example?
Hi,

anybody has an example about dynamic array in vb6? actualy i want to try in mscomm1

im sending a 4000 hex bytes to mscomm1.output i dont want to threat my 4000 hex bytes into string.. i need dynamic array so that it is fast..

regards,

Dynamic Array Set Up?
i like to set up a dynamic array.

i have the following set up code :

Private try() As String

Private Sub Command1_Click()
ReDim Preserve try(UBound(try) + 1)

try(UBound(try)) = "ta"
try(UBound(try) + 1) = "tb"
try(UBound(try) + 2) = "tc"
try(UBound(try) + 3) = "td"
MsgBox ("try0 = " & try(0) & vbCrLf & "try1 = " & try(1))

End Sub

Private Sub Form_Load()
ReDim try(0)
End Sub

what is wrong with it? can someone show me the correct or proper way to setup on a dynamic array?

Dynamic Array
Hello everybody

I want to create a dynamic array but not at the procedural level. At the procedural level I can use code such as :


VB Code:
Dim myArray() as Boolean ReDim myArray(0 To 9)


but this fails when I declare myArray as a local form variable. I would like the array to be accessed by more than one procedures.

Dynamic Array
Can somone please give me a good example code about Dynamic Array.

Thanks.

AlnavPlatinum.

Dynamic Array
VB Code:
Dim strDescription As String, intTemp As Integer, intContains As IntegerFor Each Item In strFullError    intContains = intContains + 1NextintContains = intContains - 1MsgBox intContainsFor intTemp = 0 To intContains Step 1    intTemp = intTemp + 1    MsgBox intTemp    MsgBox strFullError(intTemp)    strDescription = strDescription & " " & strFullError(intTemp)Next

im tryin to get all of the indexes from an array except for the first one (0) but when the second for loop runs, it increments in 2s? and goes from 1 to 3 so im gettin a subscript out of range errormibob, anyone know why?
cheers

ps, its in a function where strfullerror is declared as an arrayed string like strFullError() as String, im new to arrays please bare with mee :P

Dynamic Array
Hello,

Is there a way to declare a dynamic array that has the LBound start at 1?

VB Code:
public function testing(a() as double)   How do I declare the a() so that a starts at a(1)...  not a(0)?end function


Thanks!

Dynamic Array, What Is The Best Way...
I want to use an dynamic array like


VB Code:
Dim myDymArray() as myType 'then Redim preserve myDymArray(UBound(myDimArray) + 1)

This work fine if the array isn't empty. I know about two way to counter the error. First, put something in that I will not use to initiate it. Second, use On Error to handle the error.

Which is the best method or there is a better one to use?

Dynamic Array...
i'm currently working on how to cramp a whole junk of data into a multi dimension array. I try to make a dynamic multi dimension array that can be access by different forms of the same project. I've declared the array as public but it give me compile error.
(The data size is not fixed so i've to make it dynamic...). Any VB heroes around willing to help?

Dynamic Array
How can we know Array count in dynamic array ?

Dynamic Array
Hi all,
I have defined globally dynamic array as:

strAArr() as string

I need to check some where in the function whether strAArr() is already dimensioned. If its not then I have to ReDim array.
Can any one tell me how to do this

Dynamic Array Help
I am creating an application that will allow for command line arg's. The problem is that I want to stay flexible in the order and what they pass in the arg. So in other words I want them to be able to call the exe -param -param, etc. With any order they want and which arg's they chose. I then want to build a dynamic array of the args by splitting on the "-". I am not sure the best way to do this. Here is what I have so far.


Dim cmd_Line As String
Dim cmd_LineA() As String

cmd_Line = Command()

For cmd_LineA() = 1 To UBound(Split(cmd_Line, "-"))

Dynamic Array
I am going a bit loopy with this problem. Why won't this work (I get "subscript out of bounds"):


Code:
Option Explicit
Private ListArray() As String

and then ...


Code:

Private Sub OKButton_Click()

Dim i As Integer
Dim tmpCount As Integer

ReDim ListArray(0)
tmpCount = ListView1.ListItems.Count - 1

For i = 0 To tmpCount


If ListView1.ListItems.Item(i + 1).Checked = True Then
ReDim Preserve ListArray(UBound(ListArray) + 1)
ListArray(i) = ListView1.ListItems.Item(i + 1).SubItems(1)


Else
End If

Next i


MsgBox UBound(ListArray)

End Sub


Thanks

Dynamic Array
Hi,

I have 2 textboxes and 2 command buttons on my form. When I enter some number in the text1 and press command1, the value in the text box should be stored in an array. It can happen multiple times. So I need an dynamic array.
And when the user clicks command2 it should display the"total of the numbers the user entered in the text1.
Can anyone please help me doing this.

thank you,
newbee.

Dynamic Array
I need a simple dynamic array for strings in a sub.
I want to add a string value to the array and later on the sub read the array. I know how to read from the array but how do you add.

2D Dynamic Array
Can anyone kindly tell me how to declare a 2D dynamic array in Visual Basic 6.0? thanx for your help.

Dynamic Array ?
Hi

I'm writing a program in Visual basic (Visual studio beta 2005)
In this array I need to somthing like

array(0) = 0
array(1) = 1
array(2) = 2
array(3) = 3

i then delete array(2) = 2

the array must then resize to

array(0) = 0
array(1) = 1
array(2) = 3

How can I do this ?

--
thomas

Dynamic Array
I want to read the records from a databse and show it on the screen. However, I want to write a function that no matter how many columns and column name the table contain, it shows the corresponding columns and records out. That is, I first get the number of column of the record set and store it in a varible call numCol. Now, I want to declare an array colName that stores all the column name of the table. However, the problem is how can I declare the array size using numCol?

Dynamic Array Help VB6
Hi all,

I've created a global array like so


Code:

Dim fields() As FieldClass


where field class is a simple.cls file i have made which consists of


Code:

Private fieldPos As Integer
Private fieldText As String

Public Property Let Position(ByVal Pos As Integer)
fieldPos = Pos
End Property

Public Property Get Position() As Integer
GetPosition = fieldPos
End Property

Public Property Let Text(ByVal tx As String)
fieldText = tx
End Property

Public Property Get Text() As String
GetText = fieldText
End Property


i then redim the array in the method which will populate the array initially this will be 3 and then if the fieldCount (a counter) goes above three i will redim the array again to make it larger.


Code:

ReDim fields(3)


the redim if fieldcount is larger than 3 =


Code:

If (fieldCount > UBound(fields)) Then
ReDim Preserve fields(fieldCount)
End If


to create a new temporary field class, populate this and then try to add it to the array like so


Code:

Dim tmpField As New FieldClass

MsgBox ("created the field class")
tmpField.Position = fieldvars(0) 'these var are all ok i have msgbox these too

tmpField.Text = Trim(fieldvars(1))

MsgBox ("about to set the temporary field in array")
MsgBox (fieldCount) '=0 errors on first pass through
tmpv = UBound(fields)
MsgBox (tmpv)

fields(fieldCount) = tmpField

MsgBox ("added ok")


when creating each field class my program keeps on erroring whenever i try to set the fields(fieldcount)=tmpfield. i.e. i never get to the added ok message box.

please can someone telll me where i'm goig wrong, its driving me mad!

many thanks,

Matt.

Dynamic Array
I have a 2 dimensional DYNAMIC ARRAY arrConfig(a, b) how do I declare it because I am enoutering an error when using the statement with Preserve.Just to give you an example:

Dim arrConfig() as Double
.
.
.
.
.
ReDim Preserve arrConfig(UBound(arrPack), UBound(arrStack))

For intCount = 0 To UBound(arrStack)
arrConfig(UBound(arrPack), intCount) = num + 1
Next

Please help... Iget a run time error 9 when it gets to the ReDim statement. How do we use ReDim Preserve for a dynamic 2 dimensional array???

Dynamic Array
I got it, thanks guys!!!

2d Dynamic Array
I have to declare an 2-dimension dynamic array
how can i make this and redim it

Dynamic Array
Trying to create a dynamic array that gets resized based on user input and does NOT lose previous data. Think I know how to do this using PRESERVE, but not sure where to place the code. My form contains a label giving instructions, a text box for input and a command button for displaying the contents of the array.

Any suggestions/help would be appreciated by this beginner.

Dynamic Array?!
Hi out there, maybe one of you knows this:

I created a dynamic array with split.
How can I get acess to the last element of this array?

thx,

Andreas

Copyright 2005-08 www.BigResource.com, All rights reserved