473,396 Members | 2,140 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,396 software developers and data experts.

console.write

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
Feb 15 '06 #1
1 2479
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

Feb 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
3
by: Wayne | last post by:
I have a console application (ssh2.exe) that requires keystrokes to be sent to it after activating. I have worked that it needs to be started in it own thread, but capturing the process and...
5
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough...
17
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to...
7
by: mabra | last post by:
Hi All ! Problem:Reading/duplicating "Console.In" fails for unknown reason. I wrote a little console helper tool, named TEE, which just duplicates the StdIn to the StdOut AND an additional...
3
by: julianmoors | last post by:
Hey, Currently I'm writing a VB.NET/1.1 app and I need to mask the input for the password field. Does anyone know how to do this in VB? I've seen a C# example, but wouldn't know how to convert...
6
by: tony | last post by:
Hello! When you have windows forms you have the same possibility as when you have a Console application to use Console.Writeln to write whatever on the screen. Now to my question: Is it...
2
by: castironpi | last post by:
Presents a console permitting inspection. Input as well as output saved in Python-readable form. Python 2.5.1 memoryconsole4.py logging to My Documents\console.log .... def f( self ): .... ...
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.