News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

array of struct in assembly

Started by Danesh, June 14, 2005, 05:28:21 PM

Previous topic - Next topic

Danesh

Hi all,

I have defined a struct as below:

DatabasesList Struc
DBName      DB      MaxLengthOfDBName   Dup(0)
         DB      0
DatabasesList EndS


now I want to define an array (lets say 10 elements) where each element be an instance of this struct. How can I do that ?

Rgds,

Danesh


AeroASM


.data

MAX_LENGTH_OF_DB_NAME equ 63
NUMBER_OF_DATABASES equ 10

DatabaseList struct
    szDBName db MAX_LENGTH_OF_DB_NAME dup(0)
    db 0
DatabaseList ends

MyList DatabaseList NUMBER_OF_DATABASES dup(<>)

Jeff

as a word of warning, you cannot use the DUP operator when making an array of structures that contains an array of structures (or at least no one seems to know how).

refer to this thread.

Danesh

Thanks, it seems the problem is solved.