Hi Arne,
>Write 25 empty lines.
Useless if your consoles height is wider
than 25 Lines. So this is no usefull aproach!
And it allocates additional memory you dont
have to do,...you want to free something
and not to allocate more,...
>Or use a hack like:
>using System;
using System.Runtime.InteropServices;
>class MainClass
{
[DllImport("msvcrt.dll")]
public static extern int system(string cmd);
public static void Main(string[] args)
{
Console.WriteLine("Hello world");
system("CLS");
Console.WriteLine("Hello world");
}
}
Its ok, but not needed here. Do not call any
c-runtime functions until there is really a need for
it. Here you can use Marc's suggestion "Console.Clear"
which is just fine.Or use "FillConsoleOutputCharacter" or
"FillConsoleOutputAttribute" with pre-calls
to "GetConsoleScreenBufferInfo" to get the
needed information,...but here you will allocate
extra space for the cleaning memory, so you
dont have to do this,...
CLS is ok, but much better is Console.Clear, since
it is runtime handled!
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space:
http://kerem-g.spaces.live.com/
Latest Open-Source Projects:
http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."