Hello
assuming, that 1st command line argument is the name of an existing file,
the following code does not work like it is supposed to:
arg.v( 1 );

fileio.size( (type string eax) );
stdout.put( (type int32 eax), nl );
any suggestions?

clone-d


edit: corrected your title, that is better for the search engine.
Posted on 2003-01-30 08:29:55 by clone-d

Hello
assuming, that 1st command line argument is the name of an existing file,
the following code does not work like it is supposed to:
arg.v( 1 );

fileio.size( (type string eax) );
stdout.put( (type int32 eax), nl );
any suggestions?

clone-d



Well, this is one of those bugs in the HLA compile-time language I was talking
about in a different post. The problem is that @typename( (type string eax)) is
returning "dword" (for eax) rather than "string" as it really should (fileio.size is
actually a macro that tests the type of the operand and calls an appropriate
routine based on the argument type).

There are two solutions: (1) move EAX into a string variable first (ugly), or
(2) call the fileio._sizen_( string ) function directly (this is what fileio.size calls
if it determines that the argument is a string parameter, see fileio.hhf for details).

This is on my list of things to correct in HLA v1.43.
Cheers,
Randy Hyde
Posted on 2003-02-01 02:00:55 by rhyde