Using Console.Write(computer) on it's own means that that subsequent calls
will write at the next position giving:
computer : machine001machine002... etc.
If I understand you correctly what you want to see is:
computer : machine001
and then
computer : machine002
in place of what was written previously, thus giving the effect of the
machine name counting up.
To achieve this you need to force the next position back to the beginning of
the line by writing a carriage return:
Console.Write("computer : " & computer & ControlChars.Cr)
Now, in a tight loop like:
For Each computer In machinesarray
Console.Write(computer & ControlChars.Cr)
Next
it is all going to happen so fast that you are only ever going to see the
final entry.
You need to add as timing delay so that you can see it happening:
For Each computer In machinesarray
Console.Write(computer & ControlChars.Cr)
Thread.Sleep(1000) ' Wait for 1 second
Next
Adjust the parameter of the Sleep method to control the delay between
iterations of the loop.
"James" <jk****@hotmail.com> wrote in message
news:uQ****************@TK2MSFTNGP10.phx.gbl...
vb.net 2003 - console program
i've read a array of machines and i wishes to display on console the
machines name on the *same line.* How do i do this ? This is what i want
say i got a text file that contains
machine001
machine002
it shld display in console as
computer : machine001 (machine 001 will disappear, then machine002 will
appear on the same line and on the same location/placeholder)
eg
dim computer as string
for each computer in machinesarray
console.write(computer)
next