473,503 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Iterate through loop of variables

Hello-

I have numerous variables called varNameX (where X is equal to a
number from 0 to a known number "n").

Using VB.NET, I would like to iterate through all of these variables
to run comparisons.

Example:

For x as Integer = 0 to N
If varName(x).Text = "Some Text" Then
boolFlag = True
End If
Next

Is there a way to "dynamically" iterate through a collection of
variables? If so, what is the suggested way to do this? (An example
would be greatly appreciated).

Steve

Jul 10 '07 #1
1 1689
Have you trid to ask that question in the newsgroup :

microsoft.public.dotnet.languages.vb ?

This is an ASP.NET newsgroup, and the questions should be related to ASP.NET.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Steve" <le*****@gmail.comwrote in message news:11**********************@n2g2000hse.googlegro ups.com...
Hello-

I have numerous variables called varNameX (where X is equal to a
number from 0 to a known number "n").

Using VB.NET, I would like to iterate through all of these variables
to run comparisons.

Example:

For x as Integer = 0 to N
If varName(x).Text = "Some Text" Then
boolFlag = True
End If
Next

Is there a way to "dynamically" iterate through a collection of
variables? If so, what is the suggested way to do this? (An example
would be greatly appreciated).

Steve

Jul 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3833
by: Marcelo Rizzo | last post by:
I am trying to get the name of a file with a specific extension (tmw) from several different directories. The problem I am having is that the program stops working on the second pass with an run...
4
1449
by: Randall Smith | last post by:
In the case I know how may times I want to iterate, one way to do it is like this: for i in range(100000): dothis() I like how clean this syntax is, but this method is very wasteful. The...
10
8697
by: bst | last post by:
Is there a way to iterate through member variables of different names, of course, one by one from the very first one in a while loop, for example? Thanks!
2
6018
by: Yves Glodt | last post by:
Hello list, I need to iterate over a class and get all her variable names and values, e.g. considering this example: class testclass: var1 = 'ab' var2 = 'cd' var3 = 'ef'
6
3635
by: eBob.com | last post by:
How do you make a loop iterate early without using a GoTo? (I guess I've done too much structured programming and I really don't like using GoTos.) Here's my code ... For Each Thing As OFI...
28
1785
by: John Salerno | last post by:
What is the best way of altering something (in my case, a file) while you are iterating over it? I've tried this before by accident and got an error, naturally. I'm trying to read the lines of a...
3
16484
by: Steve | last post by:
Hello- I have numerous variables called varNameX (where X is equal to a number from 0 to a known number "n"). Using VB.NET, I would like to iterate through all of these variables to run...
13
2385
by: stef mientki | last post by:
hello, I generate dynamically a sequence of values, but this "sequence" could also have length 1 or even length 0. So I get some line in the form of: line = '(2,3,4)' line = '' line = '(2)'...
14
2085
by: tdahsu | last post by:
I have twenty-five checkboxes I need to create (don't ask): self.checkbox1 = ... self.checkbox2 = ... .. .. .. self.checkbox25 = ... Right now, my code has 25 lines in it, one for each...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.