?
Solved

how to perform "for each" statement in Visual Basic?

Posted on 2002-06-27
3
Medium Priority
?
293 Views
Last Modified: 2013-11-25
Hi there is an for each statement in ASP, I wonder how do I do it in Visual Basic, thank you
0
Comment
Question by:ASTronus
3 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 800 total points
ID: 7114081
one example,

Dim x(1 To 2) As Long

Dim vx

x(1) = 6
x(2) = 8

For Each vx In x

    Print vx
   
Next
0
 
LVL 5

Expert Comment

by:rpai
ID: 7114088
Dim ArrNames(2) as String
Dim vKey as Variant
ArrNames(0)="AAA"
ArrNames(1)="BBB"
ArrNames(2)="CCC"

For Each vKey in ArrNames
   Debug.Print vKey & vbCrlf
Next
0
 

Author Comment

by:ASTronus
ID: 7114098
I thought it don't have it, i'm so bad
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question