Terminal control/Dimensions: Difference between revisions

Added Kotlin
mNo edit summary
(Added Kotlin)
Line 302:
 
Note also that this will typically include 37 extra pixels horizontally and 79 extra pixels vertically, which are not available to display text. In other words, if the result was 700 500 you would really have 663 pixels of width and 421 pixels of height.
 
=={{header|Kotlin}}==
{{Works with|Ubuntu|14.04}}
<lang scala>// version 1.1.1
 
/*
I needed to execute the terminal command: 'export COLUMNS LINES'
before running this program for it to work (returned 'null' sizes otherwise).
*/
 
fun main(args: Array<String>) {
val lines = System.getenv("LINES")
val columns = System.getenv("COLUMNS")
println("Lines = $lines")
println("Columns = $columns")
}</lang>
 
{{out}}
<pre>
Lines = 24
Columns = 80
</pre>
 
=={{header|Locomotive Basic}}==
9,486

edits