The MASM Forum Archive 2004 to 2012

Project Support Forums => HLA Forum => Topic started by: desard on June 25, 2010, 11:04:16 AM

Title: hla v2.12 problem
Post by: desard on June 25, 2010, 11:04:16 AM
C:\hla\Projekte>hla setoputputattr.hla
Error in file "setoputputattr.hla" at line 14 [errid:77199/hlaparse.bsn]:
Expected ':', encountered '('
(Possible undefined ID '.setOutputAttr').
Near: << ( >>

HLAPARSE assembly failed with 1 errors
Can anybody tell me why i get the "undefined ID .setOutputAttr. I am sure the script is fine and i am using the stdlib.hhf.
The odd thing is that i can actually compile other scripts like the "Hello World" etc.
Please help
Title: Re: hla v2.12 problem
Post by: Sevag.K on June 26, 2010, 02:02:01 AM
possibly you need to include console.hhf
it may be significant to include it before or after stdlib.hhf, can't remember which.
Title: Re: hla v2.12 problem
Post by: desard on June 27, 2010, 09:21:59 AM
hey man thanks for the answer.
i tried that but the same error appears.
Title: Re: hla v2.12 problem
Post by: Sevag.K on June 27, 2010, 02:34:21 PM

ah.  the function is defined in "win32cons.hhf" and the namespace is win32cons.

Title: Re: hla v2.12 problem
Post by: desard on June 28, 2010, 11:11:16 AM
i am trying everything believe me. Exactly as the book, but it doesn't work.
The problem seems to have started when i used console.gotoxy and then console.setOutput etc. Seems to like the console command doesn't work so i have propably done something wrong during configuration, but what i can't get to find out.

Please help
Title: Re: hla v2.12 problem
Post by: Sevag.K on June 28, 2010, 08:15:03 PM
ok, can you post the entire source your trying to build?
Title: Re: hla v2.12 problem
Post by: desard on June 29, 2010, 07:11:20 AM
program testsetOutputAttr;

#include( "stdlib.hhf" );




var
   x:uns32;
   y:uns32;

begin testsetOutputAttr;

//Pastrojme ekranin
console.cls();

console.setOutputAttr( win.fgnd_LightRed | win.bgnd_Black );
stdout.put
(
nl,
"HLA console.setOutputAttr Test Routine", nl,
"--------------------------------------", nl,
nl,
"Press Enter key to continue:"
);

stdin.readLn(); //kerkon qe te shtypet Enter.

console.setOutputAttr( win.fgnd_Yellow | win.bgnd_Blue );
stdout.put
(
   "         ", nl
   "In blue and yellow   ", nl,
   "         ", nl,
   "Press enter to continue", nl
   "         ", nl
   nl
);
stdin.readLn();
//Kthejme tekstin ne bardh e zi.

console.setOutputAttr( win.fgnd_White | win.bgnd_Black );

end testsetOutputAttr;
Title: Re: hla v2.12 problem
Post by: Sevag.K on June 29, 2010, 02:59:09 PM
okay, found some outdated code in the win32console.hhf file.

the corrected file is attached.

this is the corrected setoutputattr file.



program testsetOutputAttr;

#include( "stdlib.hhf" )
#include( "win32cons.hhf")



var
   x:uns32;
   y:uns32;

begin testsetOutputAttr;

//Pastrojme ekranin
console.cls();

win32cons.setOutputAttr( win.fgnd_LightRed | win.bgnd_Black );
stdout.put
(
nl,
"HLA win32cons.setOutputAttr Test Routine", nl,
"--------------------------------------", nl,
nl,
"Press Enter key to continue:"
);

stdin.readLn(); //kerkon qe te shtypet Enter.

win32cons.setOutputAttr( win.fgnd_Yellow | win.bgnd_Blue );
stdout.put
(
   "         ", nl
   "In blue and yellow   ", nl,
   "         ", nl,
   "Press enter to continue", nl
   "         ", nl
   nl
);
stdin.readLn();
//Kthejme tekstin ne bardh e zi.

win32cons.setOutputAttr( win.fgnd_White | win.bgnd_Black );

end testsetOutputAttr;



dont' forget to link in "wincons.lib" on the command line.
Title: Re: hla v2.12 problem
Post by: desard on June 30, 2010, 10:34:33 AM
Hey man thank you very much for the help so far. I am most grateful.
Just one more question. How do i link wincons.lib
i tryed with Link command but i am not sure what to do , so please can you tell me how do i do it with the respective commands.
Thank you very much again.
Title: Re: hla v2.12 problem
Post by: Sevag.K on July 01, 2010, 02:11:16 AM

just add wincons.lib on the command line.

eg:

hla myprogram wincons.lib

Title: Re: hla v2.12 problem
Post by: desard on July 01, 2010, 10:36:03 AM
Still not working.
Does it have to do that i have a link.exe v 5.60 Dec 1994???
If so where can i download i more recent version?
cheers
Title: Re: hla v2.12 problem
Post by: Sevag.K on July 01, 2010, 06:08:54 PM
that shouldn't be an issue.  what kind of problem are you experiencing?
Title: Re: hla v2.12 problem
Post by: MichaelW on July 01, 2010, 07:53:47 PM
If the linker displays Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994, it is a 16-bit linker.
Title: Re: hla v2.12 problem
Post by: desard on July 02, 2010, 07:17:09 AM
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

usage: LINK [options] [files] [@commandfile]
i dowloaded another linker, but yes the other linker was exactly as you wrote down.
Maybe because it was a 16 bit linker it didn't work correctly.