The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: korte on April 21, 2007, 03:37:51 PM

Title: File creation and write from macro
Post by: korte on April 21, 2007, 03:37:51 PM
Possible?

possiblie file creation and write from masm32 macro in complilation time?
Title: Re: File creation and write from macro
Post by: u on April 21, 2007, 07:51:09 PM
Nope.

For this task, I use "echo", get the output text and write it manually into a file.
Title: Re: File creation and write from macro
Post by: drizz on April 22, 2007, 12:11:29 AM
something like this?
%echo @FileCur built @Date @Time with Masm version @Version on @Environ(OS) using processor @Environ(PROCESSOR_IDENTIFIER)
or with data
szer db 9,9,"(c) drizz 2005",13,10,13,10,13,10
db "built: ",9,9,@CatStr(<!">,@SubStr(%@Date,4,2),<.>,@SubStr(%@Date,1,2),<.>,@SubStr(%@Date,7,2),<!">),9
db "with masm v",@CatStr(<!">,@SubStr(@CatStr(<%@Version>),1,1),<.>,@SubStr(@CatStr(<%@Version>),2,2),<!">),13,10
db "on:",9,9,@CatStr(<!">,@Environ(OS),<!">),13,10
db "processor:",9,@CatStr(<!">,@Environ(PROCESSOR_IDENTIFIER),<!">),0

Title: Re: File creation and write from macro
Post by: zooba on April 22, 2007, 02:41:15 AM
The first one. You can then pipe it into a separate file. I use this method for my larger libraries to automatically generate a list of prototypes or a module definition file.

Make sure you use the '/nologo' flag, otherwise you'll get the ML header in there too. Also note that ML and LINK both send errors to standard output, rather than standard error, so they'll be hidden inside the files. IF ERRORLEVEL 0 should be true (ie the following command will be run) if no errors occurred.

Cheers,

Zooba :U