Terminal control/Dimensions: Difference between revisions
m
→{{header|Wren}}: Minor tidy
(→Visual Basic .NET: Listed example is .net, not classic vb) Tags: Mobile edit Mobile web edit |
m (→{{header|Wren}}: Minor tidy) |
||
(One intermediate revision by one other user not shown) | |||
Line 127:
Number of rows: 24
</pre>
=={{header|AppleScript}}==
<syntaxhighlight lang="AppleScript">local numColumns, numRows
tell application "Terminal"
if not running then activate
set {numColumns, numRows} to {number of columns, number of rows} of tab 1 of window 1
end tell
</syntaxhighlight>
=={{header|Applesoft BASIC}}==
Line 872 ⟶ 880:
=={{header|Wren}}==
As there is currently no way to obtain this information via Wren CLI, we instead embed a Wren script in a C application and ask the host program to get it for us.
<syntaxhighlight lang="
class C {
Line 886 ⟶ 894:
<br>
We now embed this Wren script in the following C program, compile and run it.
<syntaxhighlight lang="c">
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Line 961 ⟶ 971:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
|