News:

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

Are there macros like __FILE__ and __LINE__ in masm

Started by untio, November 22, 2009, 04:46:08 PM

Previous topic - Next topic

untio

Hi,
I am coding a masm32 project and I like to indicate when there is an error the line number and the source file name where it occurs.
In C this is accomplished with the __FILE__ and __LINE__ macros.
I am thinking if there is an equivalent in masm32.

Thanks in advance for your answer.

jj2007

This is line 5 of tmp_file.asm

Like this?

include \masm32\include\masm32rt.inc

.code
start:
tmp$ CATSTR <print chr$("This is line >, %@Line, < of >, @FileCur, <", 13, 10)>
tmp$
inkey "Press any key"
exit ; short form of invoke ExitProcess, 0

; to add a proc, put the cursor here and click on AutoCode, Procedure

end start

untio

Hi,
A big thank you to jj2007.

Your answer works fine.

Best regards.