include \masm32\include\masm32rt.inc
.code
start:
@CatStr(<print chr$("Built on >, @Date, < at >, @Time, <", 13, 10)>) ; *** fails miserably ***
tmp$ CATSTR <inkey chr$("Built on >, @Date, < at >, @Time, <", 13, 10)>
tmp$
exit
end start
@CatStr() works only in specific settings. Here are a few examples from MasmBasic's Switch_ ... Endsw_ macro:
Switch_ @CatStr(<swMax>, %MbSct, <=-2147483648>)/@CatStr(<swMin>, %MbSct, <=2147483648>
@CatStr(<swMin>, %MbSct, <=2147483648>)/@CatStr(<swArg$>, %MbSct, < equ >, <arg
@CatStr(<swArg$>, %MbSct, < equ >, <arg>)/@CatStr(<swCase>, %MbSct, <=0>)
@CatStr(<swCase>, %MbSct, <=0>)/@CatStr(<jmp swEnd>, %MbSct)
@CatStr(<jmp swEnd>, %MbSct)/ENDM
Case_ curCase=@CatStr(<swCase>, %MbSct)/if curCase
@CatStr(<swCase>, %MbSct, <=swCase>, %MbSct, <+1>) ; inc global case counter/c
@CatStr(<MbSwMin=swMin>, %MbSct)/@CatStr(<MbSwMax=swMax>, %MbSct)
@CatStr(<MbSwMax=swMax>, %MbSct)/FOR cArg, <args>
@CatStr(<MbCase>, %MbSct, <_>, %ctCase, <_>, %curCase, < textequ >, tmp$, <>)/ctCa
@CatStr(<swMin>, %MbSct, <=MbSwMin>)/@CatStr(<swMax>, %MbSct, <=MbSwMax>)
@CatStr(<swMax>, %MbSct, <=MbSwMax>)/@CatStr(<@MbCase>, %MbSct, <_>, %curCase,
@CatStr(<@MbCase>, %MbSct, <_>, %curCase, <:>)/; % echo -------------- cDo: cDo
Default_ @CatStr(<@MbCase>, %MbSct, <_D:>)/ENDM
Endsw_ @CatStr(<@MbCase>, %MbSct, <_D:>)/endif
@CatStr(<swa$ equ !<swArg$>, %MbSct, !>)/@CatStr(<swEnd>, %MbSct, <:>)
@CatStr(<swEnd>, %MbSct, <:>)/if @64
@CatStr(<lea rdx, @MbSwOut>, %MbSct)/push rdx
@CatStr(<push offset @MbSwOut>, %MbSct)/endif
@CatStr(<MbSwMin=swMin>, %MbSct)/@CatStr(<MbSwMax=swMax>, %MbSct)
@CatStr(<MbSwMax=swMax>, %MbSct)/cases=@CatStr(<swCase>, %MbSct)
cases=@CatStr(<swCase>, %MbSct)/curCase=0
ses, < cas>, <es found, >, @signed$(MbSwMin), < .. >, @signed$(MbSwMax), <, uses >,
c$ equ @CatStr(<MbCase>, %MbSct, <_>, %ctCase, <_>, %curCase)/oa INSTR c$, <..>
@CatStr(<jmp @MbCase>, %MbSct, <_D>)/else
@CatStr(<jl @MbCase>, %MbSct, <_D>)/cmp swa$, MbSwMax
@CatStr(<jg @MbCase>, %MbSct, <_D>)/oa = opattr swa$
@CatStr(<lea r9, @MbSwT>, %MbSct, <[-SIZE_P*MbSwMin]>)/lea swa$, [r9+SIZE_P*swa$
@CatStr(<jmp @MbSwT>, %MbSct, <[SIZE_P*swa$-SIZE_P*MbSwMin]>)/endif
@CatStr(<@MbSwT>, %MbSct, <:>)/ctImm=MbSwMin
@CatStr(<jmp @MbCase>, %MbSct, <_D>)/endif
@CatStr(<@MbSwOut>, %MbSct, <:>)/MbSct=MbSct-1