Solved

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

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

724 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