Re: Changing the name of a variable using code

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



They are in two single arrays from a database recordset. I'm up for
any suggestions.

George Nicholson wrote:
I don't think you can make X = 23 but you could create a function to which
you would pass your variable name & get the variable value back so that:
GetFromArray(X) = 23.
(The function would have to loop through the entire array looking for X, get
the corresponding value & exiting the loop once found)

This would allow you to access the array elements much like the elements of
a collection, which raises the question (in my mind at least) if you
wouldn't be better off simply putting your variables into a collection in
the first place. It may be a coin toss depending on what you are doing.

HTH


<pltaylor3@xxxxxxxxx> wrote in message
news:1168437599.875075.21790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have an array that is two wide and an undefined length. The first
column is a name of a variable and the second column is the value of
that variable. How can i define all the items as there name = value?
i.e array(1,0) = X array(1,1) = 23 make it so that X = 23. This is
probably really simple and i would appreciate any help.
thanks
Perry


.



Relevant Pages

  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Kevin Backmann ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • Re: Displaying a large amount of data quickly (VB6)
    ... >>> involving a loop of VB code would be too slow. ... but I'd sure be interested to know if that StringBuilder ... Array elements: 25000 ... Array construction: 17 ...
    (microsoft.public.vb.controls)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)