Terminal control/Dimensions: Difference between revisions
m
→{{header|Wren}}: Minor tidy
Rmfsolutions (talk | contribs) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 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 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 969 ⟶ 971:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
|