Terminal control/Unicode output: Difference between revisions
m
→{{header|Wren}}: Oops!
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
m (→{{header|Wren}}: Oops!) |
||
(One intermediate revision by the same user not shown) | |||
Line 629:
{{trans|C}}
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 642:
<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 715 ⟶ 717:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
|