?
Solved

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

Posted on 2002-06-27
3
Medium Priority
?
285 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

764 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