MATLAB Link for Code Composer Studio Development Tools    
getmember

Return an object that accesses one member of a structure

Syntax

Description

objname2 = getmember(objname,membername) returns the object objname2 that represents membername, a member of the structure that objname accesses. membername must be a string and objname must represent a structure in memory. Once you create objname2, it becomes the object you use to read and write membername. Along with createobj, these are the only functions that create objects in the product.

The class of objname2 depends on the data type of membername--numeric structure members return numeric objects, enumerated members return enum objects, pointers return pointer objects, and so on.

objname2 = getmember(objname,index,membername)

Examples

Suppose you have declared a structure in your source code called testdeepstr, using code like this:

Now, getmember creates objects that directly access members of str_recur.

Even when the structure member is itself a structure, getmember provides access directly to the nested structure, or indeed to members within the nested structure.

Numeric object s_int is now your handle to write to or read from member s_double.

See Also

createobj, read, write


  get goto