473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

for loop with array problem

137 100+
Hello,
I'm trying to write to a listbox from an array.
But i need the first 3 (0,1,2,3) indices of the array and then a VbCrLf
I wrote this:
Expand|Select|Wrap|Line Numbers
  1. Try
  2.             Dim TextFile As String = ("C:\woodsheets.txt")
  3.             Dim Reader As StreamReader
  4.             Reader = File.OpenText(TextFile)
  5.             Dim ReadContents As String
  6.             ReadContents = Reader.ReadToEnd()
  7.             Dim Array() As String = Split(readcontents, ";")
  8.             Dim i As Integer
  9.             For i = 0 To UBound(Array)
  10.                 Stock.Items.Add(Array(i) & ";" & vbTab & Array(i) & ";" & vbTab)
  11.             Next 
  12.         Catch
  13.             MsgBox("Cannot find the text file!")
  14.             Me.Close()
  15.         End Try
now he does every array indice on 1 line.
But i need 3 indices on one line and then the next line.
How can i do that?

Thanx,
Paul
Aug 6 '07 #1
1 1138
djpaul
137 100+
oh wait, i had to replace the delimiter ";" with VbCrLf

Gr Paul
Aug 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: build | last post by:
G'day All, I have a problem with this loop. There are a number of .txt files in 'myPath'. tmpFile = Dir(myPath & "\*.txt") 'PROCESS FOLDER Do Until tmpFile = "" <lottsa code> <too much to...
6
by: Ravi | last post by:
Hi All, I am trying to execute a select statement using the DBI module of perl in a for loop. I am getting a strange behaviour, the select statement is excuting correctly only for the last element...
12
by: reynoldscraigr | last post by:
Hi All, hope someone can see what wrong here I have the following function function RemoveMenuFromHoldArray(menuName) { var i = 0; for (i=0;i<=MenusToHoldOpen.length-1;i++) { if...
3
by: Morgan Wolfe | last post by:
Hello. I'm working on some simple code to generate a list of random integers and store them in a 50 element array. I have two conditions that I'm checking, first, that i < length(array) and...
3
by: pertheli | last post by:
Hello, I have a large array of pointer to some object. I have to run test such that every possible pair in the array is tested. eg. if A,B,C,D are items of the array, possible pairs are AB, AC,...
10
by: Nick L | last post by:
I'm working on a function which creates a pointers to an array of unsigned ints based off a number read from a file. I then continue to read file names from the file, convert the name to a char*...
15
by: James Black | last post by:
If you go to http://dante.acomp.usf.edu/HomeworkAssistant/index.php you will see my code. Type in: s = a + b and hit tab, and you will see the extra words. How do I remove these? Here is a...
1
by: 2stepme | last post by:
I know I should be using a database ... but ... I have created a few pages which store user data in text files. The user text files where created using session_encode. There is a text file for...
1
by: sumitmishra | last post by:
HI FRIENDS i have a problem . i am trying to allocate array inside the for loop . Below is my code here int** character has been allocated inside the for loop and then i have used the delete...
1
by: Doug_J_W | last post by:
I have a Visual Basic (2005) project that contains around twenty embedded text files as resources. The text files contain two columns of real numbers that are separated by tab deliminator, and are...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.