Hello to everyone!

I'm a new user of the Win32 Asm.
I tried to generate automatically numbered labels with a macro instruction, but I did not succeed. For example:


MyComboItem1 db 'Item1',0
MyComboItem2 db 'Item2',0
etc...


Here is the Macro, what I wrote:


COMBOBOX MACRO ComboControl:REQ,ComboItem:VARARG
LOCAL N
ComboControl label BYTE
N = N + 1
FOR arg,<ComboItem>
ComboControl&&N db arg,0
ENDM
ENDM


I called the macro in the following form: COMBOBOX MyCombo,'Item1','Item2'
and I get error, because the MyCombo1 and MyCombo2 labels does not create.

Where did I do wrong, can you help me please?
Posted on 2004-03-27 13:06:14 by bszente
<snipped>

EDIT: Just realized this macro didn't do exactly what you asked for... :(
Use Ratch's instead. :)
Posted on 2004-03-28 13:42:45 by QvasiModo
bszente,



COMBOBOX MACRO P1:REQ,P2:VARARG
LOCAL N
N = 0
P1 LABEL BYTE
FOR ARG,<P2>
N = N + 1
@CatStr(P1,%N) DB ARG,0
ENDM
ENDM

.DATA
DWORD 5

COMBOBOX MYCOMBOITEM,<'ITEM'>,<'ITEM'>,7

.CODE
MAIN:
MOV EAX,OFFSET MYCOMBOITEM2

END MAIN


Ratch
Posted on 2004-03-28 16:17:59 by Ratch
Thank you, Ratch and QvasiModo. :alright:

I included in my project and it worked fine.

Until this time I worked with TASM, and in that assembler it was enough to write the && concatenation operator.
I "upgarded" to MASM32 very recently, fortunetly Win32Asm programming is very-very good supported.

bszente
Posted on 2004-03-29 04:34:03 by bszente