Solved

Getting a cascaded For Next loop to execute they way I need it to

Posted on 2004-08-24
2
185 Views
Last Modified: 2012-05-05
I am trying to extract a series of data from a variable.  The variable is 102 characters long.  Each piece of data is 2 digits long.  Instead of writing 51 midstring statements, how can I create a for next loop to do the job.  Here is what I am thinking but I know I do not have the right syntax.  Help....Thanks


Kenny

            Dim X As Int16
            Dim Y As Int16
            For x = 1 To 51 and Y = 1 to 51
                Dim readingElaobj(X) As Int16
                readingElaobj(X) = Mid(readingElaObjNumbers, Y, 2)
                Y = Y + 1
            Next
0
Comment
Question by:kwh3856
2 Comments
 
LVL 14

Accepted Solution

by:
ptakja earned 500 total points
ID: 11886624
Try this:
Dim idx As Integer = 0
Dim readingElaobj(51) As Int16
For X = 0 To 101 Step 2
   readingElaobj(idx) = Mid(readingElaObjNumbers, X, 2)
    idx += 1
Next



 
0
 

Author Comment

by:kwh3856
ID: 11886647
Thanks for the quick response.

Kenny
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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

937 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

6 Experts available now in Live!

Get 1:1 Help Now