# Bind a Definition to a Variable
> [HTML Version](bind_a_dynstruct.htm)
Binding a dynstruct definition to a dynstruct variable is a one-line operation, once the dynstruct has been defined and the variable declared…
map1 status,i,4 \! status variable
map1 ds, dynstruct \! dynstruct variable
status = Fn'Dynst'Bind("ST\_TEST", ds)
if status < 0 then
_As in the previous example, instead of using the _MX\_DYNSTRUCT_ call directly, here we used a wrapper function from _[fndynst.bsi in SOSLIB:\[907,10\]](https://bitbucket.org/microsabio/soslib/src/master/907010/fndynst.bsi)_, mainly to isolate us from possible changes in the implementation of the underlying mechanism. Using the _MX\_DYNSTRUCT_ directly would look like this:_
map1 status,i,4 \! status variable
map1 ds, dynstruct \! dynstruct variable
xcall MIAMEX, MX\_DYNSTRUCT, DYNOP\_BIND, status, "ST\_TEST", ds
if status < 0 then
Once the dynstruct definition has been bound to the dynstruct variable ds, the variable will have same size as the defined structure (ST\_TEST) and can be copied to/from traditional structure variables of the same type, or X,0 variables. The following assumes that ds was defined and bound as show above.
map1 test1, ST\_TEST \! traditional structure
test1 = ds \! copy from DYNSTRUCT var to traditional structure
ds = test1 \! or vice versa
To copy a bound dynstruct variable and its bound definition to another dynstruct variable that has not yet been bound, use the MX\_DYNSTRUCT DYNOP\_COPY or its wrapper function.