Terminal control/Unicode output: Difference between revisions

m
m (syntax highlighting fixup automation)
 
(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="ecmascriptwren">/* terminal_control_unicode_outputTerminal_control_Unicode_output.wren */
 
class C {
Line 642:
<br>
We now embed this Wren script in the following C program, compile and run it.
<syntaxhighlight lang="c">#include/* <stdlibgcc Terminal_control_Unicode_output.h>c -o Terminal_control_Unicode_output -lwren -lm */
 
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Line 715 ⟶ 717:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "terminal_control_unicode_outputTerminal_control_Unicode_output.wren";
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
9,477

edits