How to remove "(" and ")" character in macro output
calling macro:
testmac (anything,something)
want output:
anything,something
korte,
Unless you are doing something that I am unaware of, the parenthesis has no effect on the output. For example, if I have the following macro:
txt MACRO Text:VARARG
LOCAL dbText
.DATA
dbText BYTE Text,0
.CODE
ExitM < offset dbText >
ENDM
... and I invoke it in the following manner:
mov [esi].lpszText, txt("New Project")
The output is New Project, without any parenthesis or quotation marks.
HTH,
Paul
The problem
testmac (xxx,yyy)
testmac macro text:vararg
.
.
invoke text
testmac xxx,yyy
?
NO.
I want call macro C style
CreateWindow(0,0,0,0,0,0)
CreateWindow is macro. i want convert "(" and ")" to space or skip.
use substr
God idea, :clap:
But not work :'(
testmac macro p1,p2
%echo parameter 1: p1
%echo parameter 2: p2
endm
removebracket macro text:VARARG
tlen textequ @SizeStr(<text>)
nobracket SubStr <text>,2,tlen-2
exitm <nobracket>
endm
testmac removebracket (123,456)
Problem: testmac only 1 parameter "123,456"
The "123,456" string non break 2 parameter "123" and "456" :(
For a macro function, the argument list must be enclosed in "parenthesis", and the parenthesis will not be treated as part of the arguments. A macro function differs from a macro procedure in that it returns a value using the EXITM directive.
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
testmac1 macro p1,p2
%echo parameter 1: p1
%echo parameter 2: p2
endm
testmac2 macro p1,p2
%echo parameter 1: p1
%echo parameter 2: p2
exitm <eax>
endm
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
.data
.code
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
start:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
testmac1(123,456)
testmac2(123,456)
inkey "Press any key to exit..."
exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
parameter 1: (123
parameter 2: 456)
parameter 1: 123
parameter 2: 456
Is this what you are wanting to do?
No!
testmac2 macro p1,p2
%echo parameter 1: p1
%echo parameter 2: p2
endm
testmac2 (123,456)
Output is:
parameter 1: (123
parameter 2: 456)
:bg :bg :bg
work. Thanks
testmac2 macro p1,p2
%echo parameter 1: p1
%echo parameter 2: p2
exitm <>
endm