When parameters names in a macro and function
are the same and when function invokes a macro
this doesn't compile

Example:
#macro TestMacro(parameter);
pushd(parameter);
#endmacro;

procedure TestProc(parameter: dword);
@nostackalign; @nodisplay;
begin TestProc;
TestMacro(parameter);
end TestProc;

HLA Compiler message:
HLA text buffer redirection stack overflow.
Near: << parameter >>
Posted on 2003-10-31 05:33:50 by Elohim Meth

When parameters names in a macro and function
are the same and when function invokes a macro
this doesn't compile

Example:
#macro TestMacro(parameter);
pushd(parameter);
#endmacro;

procedure TestProc(parameter: dword);
@nostackalign; @nodisplay;
begin TestProc;
TestMacro(parameter);
end TestProc;

HLA Compiler message:
HLA text buffer redirection stack overflow.
Near: << parameter >>


This is a known problem in HLA v1.x, that is not going to get fixed
until HLA v2.0. Parameter names must be unique in the context
where you expand the macro. Therefore, the fact that your actual
parameter name matches the formal parameter name is the problem
here.

The work-around is to use a globally unique name for the formal
parameter. Usually what I do is specify a name of the form
"name_macroName", e.g.,

#macro TestMacro(parameter_TestMacro);
pushd(parameter_TestMacro);
#endmacro;
Posted on 2003-10-31 10:04:28 by rhyde
Thanks for reply Mr.Randall
I will wait with eager for version 2.0 of HLA!
Posted on 2003-10-31 10:10:35 by Elohim Meth


I will wait with eager for version 2.0 of HLA!



We all will :grin:
Posted on 2003-10-31 22:24:45 by Odyssey