Re: accessing Struct field

From: flekso (taurus_at_email.hinet.hr)
Date: 05/07/04


Date: Fri, 7 May 2004 09:40:51 +0000 (UTC)


"Vaektor" <vaektor_phresh@hotmail.com> wrote in message
news:k7Emc.6011$jF2.2432@newssvr27.news.prodigy.com...
> I'm trying to access the 'name' field of my structure but when I try to
masm
> gives me an error:
>
> error A2008: syntax error : name
>
> here's the struct
>
> STUDENT STRUCT
> idNum WORD -1
> name BYTE 20 DUP(0)
> age WORD 0
> Student ENDS
>
> .data
> dbEntries = 50
> studentDB STUDENT dbEntries DUP(<>)
>
> and my lines of code:
>
> mov si, 0
> mov dx, OFFSET (STUDENT PTR StudentDB[si].name)
> mov cx, (SIZEOF STUDENT PTR StudentDB[si].name)
>

Try renaming name to _name or something like that, maybe it's a
keyword/macro.



Relevant Pages