By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,462 Members | 799 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,462 IT Pros & Developers. It's quick & easy.

Declare Looping Variable

P: 21
Hi,

I want to declare a variable outside a loop.
The variable then needs to change everytime it runs within the loop.
example:

DataRow name;

//Once in the for loop, the variable name must change to

name1 then name2, name3, name 4 and so on..

How do i do this?
Apr 23 '07 #1
Share this Question
Share on Google+
2 Replies


prabunewindia
100+
P: 199
try to use DataRow array
DataRow[] name=new Datarow[length];

Hi,

I want to declare a variable outside a loop.
The variable then needs to change everytime it runs within the loop.
example:

DataRow name;

//Once in the for loop, the variable name must change to

name1 then name2, name3, name 4 and so on..

How do i do this?
Apr 23 '07 #2

Frinavale
Expert Mod 5K+
P: 9,731
Hi,

I want to declare a variable outside a loop.
The variable then needs to change everytime it runs within the loop.
example:

DataRow name;

//Once in the for loop, the variable name must change to

name1 then name2, name3, name 4 and so on..

How do i do this?
I'm not sure what language you're using.
I'm not exactly sure what you're trying to do

You could do something like:

Expand|Select|Wrap|Line Numbers
  1.      Dim name As String 
  2.      While (Not name = "something")
  3.          If (...) Then
  4.            name="something"
  5.          End IF
  6.       End While
  7.       txtName.Text = name
  8.  
Could you explain the problem a bit more?

-Frinny
Apr 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.