Re: How to pass an dynamic array between modules?



Pass the array by reference within the function.

Public Function fGetContentsStream(ByRef arrayOLE() As Byte, _
FileExtension As String, _
Optional FileNamePackage As String = "") As Boolean

Now in the function itself, you can redim the array as desired.

' Size our main array
ReDim arrayOLE(0 To UBound(arrayB))

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Troy" <TroyDDaniels@xxxxxxxxx> wrote in message
news:1175207217.677550.269590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a dilemma where I am creating a dynamic two dimensional array
and filling it with information from a .csv file. Unfortunately,
later when I try to call that information back from the array I get an
error or I don't get anything back at all. I'm not sure how to make a
dynamic array public (so to speak) so that I can call the information
back between modules or forms. Can anyone help? Thanks.



.



Relevant Pages

  • Re: Help Please - Searching a large text file
    ... an array with about 500 elements to start with, and only Redim it when the ... Dim LensDataArrayAs String, FileNumber As Long ...
    (comp.lang.basic.visual.misc)
  • Re: Help Please - Searching a large text file
    ... Actually you can speed that part of it up about three or four times by writing it in such a way that it does not Redim the array every single time through the loop. ... Dim LensDataArrayAs String, FileNumber As Long ...
    (comp.lang.basic.visual.misc)
  • Re: ReDim an array AFTER its loaded into another array
    ... '.RteInfo2 as string 'etc depending on how many pieces of data you need ... Redim vRteFactsAy ... ' RFA is the route facts array ... Once a "master" array is formed, it looks like the component arrays ...
    (microsoft.public.excel.programming)
  • Re: Error on UBound with Dynamic Array
    ... determine the difference in length of the string. ... Doug Steele, Microsoft Access MVP ... ReDim Preserve arrSplit+ 1) ... need to use a dynamic array and may be checking the boundries, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Error on UBound with Dynamic Array
    ... Hadn't realized ReDim was 'expensive'. ... determine the difference in length of the string. ... need to use a dynamic array and may be checking the boundries, ... If locEnd = 0 Then ...
    (microsoft.public.access.modulesdaovba)