GetMember (open)
Retrieve a member from an object by name
Syntax
// Core function, no LOADLIB necessary
VARIANT FUNCTION GetMember(OBJECT obj, STRING membername)
Parameters
OBJECT obj
Object to read
STRING membername
Name of the member to look for
Return value
VARIANT
The data in the requested member
Description
GetMember retrieves the value of a member from object @italic rec with the name @italic cellname. Member names are case-insensitive. If the object does not contain a member with the requested name, a HareScript error is generated. GetMember cannot be used to retrieve function pointers to object methods, use @italic GetObjectMethodPtr instead.
GetMember can be used to retrieve members with a dynamically generated name.
Examples
// Retrieve ‘file->title’
STRING title := GetMember(file,"title");
// Dynamic generation of a cellname example
STRING membername := "ti" || "tle";
STRING title := GetMember(file, membername);