with your code as :
i get following compile error
Compiling ulibapl.pas
cb.pas(15,47) Error: Identifier not found "TAPL_value"
cb.pas(15,64) Error: Identifier not found "cint"
cb.pas(15,71) Error: Identifier not found "cint"
cb.pas(19,9) Error: Identifier not found "print_value_to_string"
cb.pas(21,14) Error: Operator is not overloaded: "<erroneous type>" = "ShortInt"
cb.pas(30,1) Error: Identifier not found "res_callback"
cb.pas(33,1) Error: Identifier not found "res_callback"
cb.pas(44) Fatal: There were 7 errors compiling module, stopping
are you using a new ulibapl.pas that i do not have ??
program cb;
{$linklib apl}
//uses libaplu;
uses ulibapl;
var
global_exec_callback_result : string;
err: Tlibapl_error;
exec_result: string;
const example = '2*8';
function exec_callback(const value: TAPL_value; committed: cint): cint; cdecl;
var temp:pchar;
begin
global_exec_callback_result := '';
temp := print_value_to_string(value);
// if value has not been committed
if committed = 0
then setstring(global_exec_callback_result,temp,strlen(temp));
// do not commit
result := 0;
end;
// wrapper function
function apl_exec(apl_line: string; out ret_value: string): Tlibapl_error;
begin
res_callback:=@exec_callback;
result:=ulibapl.apl_exec(apl_line);
ret_value:=global_exec_callback_result;
res_callback:=nil;
end;
begin
init_libapl(argv[0], 0);
err := apl_exec(example, exec_result);
if err = 0
then writeln('.APL code "', example, '" was interpreted successful: answer = ', exec_result)
else writeln('.APL code "', example, '" failed miserably');
end.