Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A way around arrays

Status
Not open for further replies.

Tommyhat

Programmer
Sep 10, 2004
96
CA
I have a function with a 2d array in it. but since it's called all the time it keeps being reset to zero when dim'd. I tried making it public in a module but it seems to be causing ridiculous memory leakage.

Is there a way i can get around this 're-dimery' without using a public array or some way to fix my leaking memory?

<hr>
2b||!2b that = the_question
 
I am not sure I understood your problem - maybe a bit of code would help ?
But maybe a Class/Collection could be a solution ?
Or - if you are working with a database, use a table ?

 
Zee code:
Public Function Jinks(Action As Integer)
Dim indexy As Integer
flex.Col = 3
Select Case (val(flex.Text))
Case 2:
indexy = 0
Case 78:
indexy = 1
Case 91:
indexy = 2
Case 117:
indexy = 3
Case 135:
indexy = 4
End Select
If Action = 0 Then
'Adding
flex.Col = 1
If flex.Text <> "" Then
flex.Col = 2
If flex.Text <> "" Then
flex.Col = 3
If flex.Text <> "" Then
flex.Col = 4
If flex.Text <> "" Then
yarray(flex.row, indexy) = val(flex.Text)
End If
End If
End If
End If
ElseIf Action = 1 Then
'Reading
flex.Col = 4
flex.Text = yarray(flex.row, indexy)
End If


End Function


The array (in a module)
Public yarray(0 To 6, 0 To 4) As Integer

---------------------------------------
2b||!2b that == the_question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top