Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-08-24
2
Medium Priority
?
193 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 2000 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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 When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

926 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