The MASM Forum

General => The Campus => Topic started by: ragdog on January 11, 2014, 07:38:09 AM

Title: Build information on resource control
Post by: ragdog on January 11, 2014, 07:38:09 AM
Hi

I playing a little with Visual studio and have found an example it build infos  date and time at compile the project

this is define in the source
SetDlgItemText(hDlg, IDC_BUILD, "Built on "__DATE__ " at " __TIME__"");

is this possible for Masm?
Title: Re: Build information on resource control
Post by: dedndave on January 11, 2014, 08:06:25 AM
i think there is a masm32 macro that allows inline text ("inv", maybe or "rv")
or - you can define the string in the .DATA section and pass a pointer
Title: Re: Build information on resource control
Post by: jj2007 on January 11, 2014, 09:17:42 AM
Plain Masm32:
   tmp$ CATSTR <chr$("Built on >, @Date, < at >, @Time, <")>
   invoke SendMessage, hEdit, WM_SETTEXT, 0, tmp$

MasmBasic:
   SetWin$ (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1092) hEdit="Built on "+CrtDate$ (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1168)+" at "+CrtTime$ (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1169)
Slightly more ambitious:
   SetWin$ (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1092) hEdit="Launched on "+Date$ (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1168)+" at "+Time$ (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1169)
Title: Re: Build information on resource control
Post by: Magnum on January 11, 2014, 10:24:00 AM
Quote from: ragdog on January 11, 2014, 07:38:09 AM
Hi

I playing a little with Visual studio and have found an example it build infos  date and time at compile the project

this is define in the source
SetDlgItemText(hDlg, IDC_BUILD, "Built on "__DATE__ " at " __TIME__"");

is this possible for Masm?

This works.

Andy

.data

%Date       db  " &@Date " ; Compile date
%time       db  " &@Time"
Title: Re: Build information on resource control
Post by: ragdog on January 12, 2014, 03:35:13 AM
Thank you it works

Quotetmp$ CATSTR <chr$("Built on >, @Date, < at >, @Time, <")>
   invoke SendMessage, hEdit, WM_SETTEXT, 0, tmp$

@Date or @Time is this a macro or define in the linker oder ml?
Title: Re: Build information on resource control
Post by: jj2007 on January 12, 2014, 03:47:46 AM
Quote from: ragdog on January 12, 2014, 03:35:13 AM
@Date or @Time is this a macro or define in the linker oder ml?

They are Masm/JWasm "built-in" macros (@CatStr, @code, @CodeSize, @Cpu, @CurSeg, @data, @DataSize, @Date, @Environ, @fardata, @fardata?, @FileCur, @FileName, @InStr, @Interface, @Line, @Model, @SizeStr, @stack, @SubStr, @Time, @Version, @WordSize).