Error in file "hlaFunc.hla" at line 76 [errid:82229/hlaparse.bsn]:
Too few actual parameters.
Near: << ) >>
HLAPARSE assembly failed with 1 errors
代码是:
unit hlaFuncUnit;
#include( "stdlib.hhf" )
procedure hlaFunc( i:int32 ); @cdecl; @external( "_hlaFunc" );
procedure BuildExcepts; @external("BuildExcepts__hla_");
procedure HardwareException; @external( "HardwareException__hla_" );
procedure DefaultExceptionHandler; @external( "DefaultExceptionHandler__hla_" );
procedure HWexcept; @external( "HWexcept__hla_" );
procedure DfltExHndlr; @external( "DfltExHndlr__hla_" );
procedure QuitMain; @external( "QuitMain__hla_" );
procedure ExitProcess( rtnCode:dword ); @external( "_ExitProcess@4" );
static
MainPgmVMT: dword:= &QuitMain;
MainPgmCoroutine: dword[ 5 ]; @external( "MainPgmCoroutine__hla_" );
MainPgmCoroutine: dword; @nostorage;
dword &MainPgmVMT, 0, 0;
SaveSEHPointer: dword; @nostorage; // Still part of MainPgmCoroutine...
dword 0, 0;
procedure QuitMain;
begin QuitMain;
ExitProcess( 1 );
end QuitMain;
procedure HWexcept;
begin HWexcept;
jmp HardwareException;
end HWexcept;
procedure DfltExHndlr;
begin DfltExHndlr;
jmp DefaultExceptionHandler;
end DfltExHndlr;
procedure hlaFunc( i:int32 );
var
s:string;
begin hlaFunc;
call BuildExcepts;
try
stdout.put( "stdout.put called from HLA code, i = ", i, nl );
raise( 5 );
exception( 5 );
stdout.put( "Exception handled by HLA code" nl );
endtry;
try
stralloc( 16 );
mov( eax, s );
str.cpy( "Hello World", s );
stdout.put( "Successfully copied 'Hello World' to s: ", s, nl );
str.cpy( "0123456789abcdefghijklmnop", s );
stdout.put( "Shouldn't get here" nl );
anyexception
stdout.put( "Exception code: ", eax, nl );
ex.printExceptionError();
endtry;
strfree( s );
stdout.put( "Returning to C code" nl );
mov( SaveSEHPointer, eax );
#asm
mov fs:[0], eax
#endasm
end hlaFunc;
end hlaFuncUnit;
erro在哪里(我知道,错误是在TRY中),但是,我怎么能解决这个错误? 感谢
答案 0 :(得分:1)
问题是printExceptionError
,它应该是这样的:
ex.printExceptionError( eax, ebx, ecx, edx, edi );
所以,正如错误所说,你缺少参数。