News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Compile Problem

Started by Xor Stance, July 16, 2005, 08:25:10 PM

Previous topic - Next topic

Xor Stance

program charInputDemo;

#include( "stdlib.hhf" );

static

    c:char;

   

begin charInputDemo;



    stdout.put( "Enter a character: " );

    stdin.getc();

    if( al >= `a' ) then

   

        if( al <= `z' ) then

       

            and( $5f, al );

           

        endif;

       

    endif;

    stdout.put

    (

        "The character you entered, possibly ", nl,

        "converted to upper case, was `"

    );

    stdout.putc( al );

    stdout.put( "`", nl );

   

end charInputDemo;


I got the newest ver of HLA 1.76: I got a problem `, a and z. It would't be recognize itself by the compiler and displays error.

Vortex

Xor,

Replace all those ` with ' and your code will be compiled successfully.

Xor Stance

It still doesn't work:

Error in file "chars.hla" at line 19 [errid:7874/hla.flx]:
Illegal character in file: <`><96/$60).
Near: << ` >>

errid: 41284/hlaparse.bsn
Undefined symbol.
Near: << a >>

7875
Illegal character in file: <'>(39/$27).
Near << ' >>

same as hlaparse.bsn

Near << ) >>

This error was compile with the source code from the first example.

Error in file "os.hhf" at line 1 [errid:98726/hlaparse.c]:
syntax error, unexpected ';', expecting DoOneCalStmt.

Sevag.K

You have to use single quote  (the ' character) both time:

'a'

'z'

Do not use the key above your tab key.

Xor Stance

oops, I didn't got what Vortex told me at first, thanks. `' I thought you meant all of it with it.

DarkWolf

Ah those damned accent marks masquerading as apostrophe's again.

It's a conspiracy I say,  : )
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

Sevag.K


Ahh those accursed PDFs... if only they could get the quote right.

DarkWolf

Ahh the accursed PDF ...

Pretty Damned Fsk'd

I work with an engineer that converts schematics to pdf, not a bad idea but whatever app he uses always have that damned ColorSpace error : ( 
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

Xor Stance

program testFillRect;

#include( "stdlib.hhf" );



var

    x:uns32;

    y:uns32;



begin testFillRect;



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

    stdout.put

    (

        nl,

        "HLA console.fillRect Test Routine", nl,

        "---------------------------------", nl,

        nl,

        "Press the Enter key to continue:"

    );



    // Make the user hit Enter to continue.



    stdin.readLn();

    console.cls();



    // Test outputting rectangular blocks of color.

    // Note that the blocks are always filled with spaces,

    // so there is no need to specify a foreground color.

   

    console.fillRect( 2,  50, 5,  55," ",win.bgnd_Black );

    console.fillRect( 6,  50, 9,  55," ", win.bgnd_Green );

    console.fillRect( 10, 50, 13, 55," ", win.bgnd_Cyan );

    console.fillRect( 14, 50, 17, 55," ", win.bgnd_Red );

    console.fillRect( 18, 50, 21, 55," ", win.bgnd_Magenta );

   

    console.fillRect( 2,  60, 5,  65," ", win.bgnd_Brown );

    console.fillRect( 6,  60, 9,  65," ", win.bgnd_LightGray );

    console.fillRect( 10, 60, 13, 65," ", win.bgnd_DarkGray );

    console.fillRect( 14, 60, 17, 65," ", win.bgnd_LightBlue );

    console.fillRect( 18, 60, 21, 65," ", win.bgnd_LightGreen );

   

    console.fillRect( 2,  70, 5,  75," ", win.bgnd_LightCyan );

    console.fillRect( 6,  70, 9,  75," ", win.bgnd_LightRed );

    console.fillRect( 10, 70, 13, 75," ", win.bgnd_LightMagenta );

    console.fillRect( 14, 70, 17, 75," ", win.bgnd_Yellow );

    console.fillRect( 18, 70, 21, 75," ", win.bgnd_White );



    // Note: set the attributes back to black and white when

    // the program exits so the console window doesn't continue

    // displaying text in Blue and Yellow.

   

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

       

end testFillRect;


I tried to compile by either removing all the `'" or replace them as ' and " but it doesn't work. That's what is confusing in the HTML format version, the PDF I don't like to view it online.

Sevag.K

A few things wrong with this.

1. These functions are no longer supported in the standard library (for compatibility reasons).
You'll need to include the file "win32cons.hhf" (and this must be done before including "stdlib.hhf")

2. change all the console.xxx function calls to win32cons.xxx

3. you must link with the wincons.lib library

4. you have to pass a char and not a string to the win32cons.fillRect function.  Replace the " " with ' '

5. there is also a value out of range somewhere in there, but I'll leave it to you to figure out where.