# Define the Dynstruct Layout

> [HTML Version](define_the_dynstruct.htm)

_Rewritten July 2022_

The dynamic structure must be defined (or _"compiled"_) in a particular way—retaining the symbolic field names and positions—before it can be usefully associated with a declared dynstruct variable. This can be accomplished via either of the following methods:

•	By re-processing the DEFSTRUCT source code at runtime, either from a program file or from a string built by the application, using [MX\_DYNSTRUCT](mx_dynstruct.md) with the DYNOP\_DEF opcode.

•	By directing the compiler to embed the expanded DEFSTRUCT information in the RUN file, using one of the methods described in [Structure Definition Embedding](structuredefinitionembedding.md). 

**History**

2022 February, A-Shell 6.5.1711, compiler edit 965:  Support [Structure Definition Embedding](structuredefinitionembedding.md).