Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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