Solved

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

Posted on 2002-06-27
3
250 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 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now