Loadable Function: unpackfields (s_name, fld1, fld2, …)

Create variables from fields of a struct.

Inserts the named fields fld1, fld2, …, from the struct named s_name, into the current scope. Note that s_name is the name of the struct in the current scope, not the struct itself.

unpackfields ("struct", "var1", "var2")

is equivalent to the code:

 var1 = struct.var1;
 var2 = struct.var2;
         :          

but more efficient and more concise.

See also: getfield, getfields, packfields, struct.

Package: general