|
-
Feb 28th, 2009, 12:48 AM
#1
Thread Starter
New Member
HOw To handle large number of variables
HI,
ok here it is. I have collection of variables. now there is a calculation associated with each variable. Each variable in collection has a name too.
Now what i did is I declared a variable of same name of that of the vaiable in the collection and performed calculation and then updated/assigned the calculated value to the variable in the collection.
Now problem is that I have to write the same code for each variable in the collection.
Is there any way to minimize the code?
Is there any way I can iterate it into a loop?
Thanx.
-
Feb 28th, 2009, 01:18 AM
#2
Frenzied Member
Re: HOw To handle large number of variables
How about using arrays. The values they store can be accessed by their index
-
Feb 28th, 2009, 01:41 AM
#3
Thread Starter
New Member
Re: HOw To handle large number of variables
but is ther a way to map these variables........
I am mean each variable has different calculation... that is mandatory , unavoidable , if store the results in an array, then how to map it to that array....
-
Feb 28th, 2009, 01:47 AM
#4
Re: HOw To handle large number of variables
you can loop through a collection using for each
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 28th, 2009, 01:50 AM
#5
Frenzied Member
Re: HOw To handle large number of variables
Not clear. 
can you post some code snippets of what you are doing, so that some one can get some idea.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|