summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/libsee/examples/testwrite.pp
blob: 537e66fbf8022d482d6c200605c2c282b1b21b93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
program testwrite;

{$mode objfpc}
{$H+}

uses
  Classes, libsee, mod_stream;

Var
  interp : TSEE_interpreter;
  ainput : PSEE_INPUT;
  res    : TSEE_Value;

const
   Program_text = 'writeln("Hello, world!");';
   
begin
  see_init;
  RegisterWriteModule;
  SEE_interpreter_init(@interp);
  ainput :=SEE_input_utf8(@interp, pchar(program_text));
  See_global_eval(@interp,ainput,@res);
  see_input_close(ainput);
end.