Terminal control/Dimensions: Difference between revisions
Content added Content deleted
(Added Axe) |
Simple9371 (talk | contribs) (Added Visual Basic solution (with a bit detailed output)) |
||
Line 526: | Line 526: | ||
set HEIGHT=`tput lines` |
set HEIGHT=`tput lines` |
||
echo "The terminal is $WIDTH characters wide and has $HEIGHT lines."</lang> |
echo "The terminal is $WIDTH characters wide and has $HEIGHT lines."</lang> |
||
=={{header|Visual Basic}}== |
|||
{{trans|C#}} |
|||
<lang vb>Module Module1 |
|||
Sub Main() |
|||
Dim bufferHeight = Console.BufferHeight |
|||
Dim bufferWidth = Console.BufferWidth |
|||
Dim windowHeight = Console.WindowHeight |
|||
Dim windowWidth = Console.WindowWidth |
|||
Console.Write("Buffer Height: ") |
|||
Console.WriteLine(bufferHeight) |
|||
Console.Write("Buffer Width: ") |
|||
Console.WriteLine(bufferWidth) |
|||
Console.Write("Window Height: ") |
|||
Console.WriteLine(windowHeight) |
|||
Console.Write("Window Width: ") |
|||
Console.WriteLine(windowWidth) |
|||
End Sub |
|||
End Module</lang> |
|||
{{Out}} |
|||
I put the built application in Desktop. |
|||
<pre>\Desktop>ConsoleApplication1 |
|||
Buffer Height: 300 |
|||
Buffer Width: 80 |
|||
Window Height: 25 |
|||
Window Width: 80</pre> |
|||
Re-sizing the Console: |
|||
<pre>\Desktop>ConsoleApplication1 |
|||
Buffer Height: 300 |
|||
Buffer Width: 80 |
|||
Window Height: 14 |
|||
Window Width: 49 |
|||
\Desktop></pre> |
|||
=={{header|XPL0}}== |
=={{header|XPL0}}== |