Solved

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

Posted on 2004-08-24
2
184 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

19 Experts available now in Live!

Get 1:1 Help Now