hei, I am a chinese, sorry for my poor english.
this is my macro:

vm_oriele_var_define macro vartype,varname
ifidni
,
vmn_oriele_var_size = 4
elseifidni ,
vmn_oriele_var_size = 2
elseifidni ,
vmn_oriele_var_size = 1
elseif (OPATTR (vartype)) EQ 24h
vmn_oriele_var_size = sizeof vartype
else
vm_debug_szwant1 'vm define false !'
exitm
endif
vmn_oriele_var_alllong = vmn_oriele_var_alllong + vmn_oriele_var_size
vmt_oriele_vat_namechain catstr ,<,>,vmt_oriele_vat_namechain
varname textequ @CatStr(<>)
%echo !-- vmt_oriele_vat_namechain
%echo varname
endm

I call they here:

vm_oriele_var_define
,vpl_ttt_01
vm_oriele_var_define
,vplpi

I plan it's output :vmt_oriele_vat_namechain must be this:

!-- vpl_ttt_01,vplpi


But what ever I try, add %,&, or use @CatStrm, it just get error,
or just output like this:
!-- ,,


Please help me, I want to use : purge vmt_oriele_vat_namechain
to end macro define.
below is some of my code, use at build a temp function.

vm_oriele_var_defstart macro
push ebp
mov ebx,esp
vmn_oriele_var_alllong = 0
vmn_oriele_var_size = 0
vmt_oriele_vat_namechain textequ <>
endm
vm_oriele_var_defend macro
add esp,vmn_oriele_var_alllong
vmt_oriele_vat_namechain substr vmt_oriele_vat_namechain,1,@SizeStr(%vmt_oriele_vat_namechain)-1
%echo !end-- vmt_oriele_vat_namechain
;purge vmt_oriele_vat_namechain
endm
Posted on 2004-11-02 01:13:45 by vanish
PURGE is not very useful - it is the same as:

VarName EQU <>

I have used "VarName EQU <#>" to force error if VarName is used, but it is not always useful. What we need is "UNDEF VarName", but this is not possible in MASM (FASM does allow such flexiblity).

...I will try to understand what you are trying to do...please, use
 tags in the future.  Thank you for trying English and macros!  Much respect to you.


Another note: "%ECHO" will resolve varible to value through several layers. Example:

temp1 EQU <4>
temp2 EQU <temp1>
%ECHO temp2

See how it outputs "4"? MASM always does this.
Posted on 2004-11-02 02:19:46 by bitRAKE
Thank you for your reply, it give me many courage.
I plan to use these macro at function inner.
vm_oriele_var_defstart to instead of proc
vm_oriele_var_define <dd>,vplpi to instead of local var
vm_oriele_var_defend to declare var define end and start code.
so I can define a function in a function.
I test those macro at my function inner, they work fine.
But my quest is when my little function end, how to release these var.
if I have not choice , not to release they just work fine :)

Appear PURGE can not hand with text macro .It also resolve varible to value , and I get a error:

vm_oriele_var_define <dd>,vplpi
PURGE vplpi
F:\MSGBOX.asm(27) : error A2008: syntax error : [

I think purge resolve vplpi to , and get a error.

So queer ,some angle disappear ,so I post again here.
vm_oriele_var_define macro vartype,varname
ifidni <dd>,<vartype>
vmn_oriele_var_size = 4
elseifidni <dw>,<vartype>
vmn_oriele_var_size = 2
elseifidni <db>,<vartype>
vmn_oriele_var_size = 1
elseif (OPATTR (vartype)) EQ 24h
vmn_oriele_var_size = sizeof vartype
else
vm_debug_szwant1 'macro define false !'
exitm
endif
vmn_oriele_var_alllong = vmn_oriele_var_alllong + vmn_oriele_var_size
vmt_oriele_vat_namechain catstr <varname>,<,>,vmt_oriele_vat_namechain
varname textequ @CatStr(<>)
%echo vmt_oriele_vat_namechain
endm

I only get the PURGE explain at the web:

http://webster.cs.ucr.edu\Page_TechDocs\MASMDoc\index.html
PURGE macroname [[, macroname]]...
Deletes the specified macros from memory.

DO you had any good Grammar book or source?
Posted on 2004-11-02 07:05:56 by vanish
Do you had any good Grammar book or source?
Webster book is true of intent, but does not work as intent. My only source is experience of same problem you have, and personal test of PURGE function.

There is another Chinese forum member with similar ideas to your own taowen2002. He could provide very concise help. MOOP 1.0 released is his latest project posted on the board. He has many posts on macro and OOP x86 methods.
Posted on 2004-11-02 19:04:03 by bitRAKE