MemberUpdate (open)

Update a member in an object

Syntax

LOADLIB "wh::system.whlib";

MACRO MemberUpdate(OBJECT obj, STRING membername, VARIANT value)

Parameters

OBJECT obj

Object to modify

STRING membername

The name of the member to update

VARIANT value

The new value for the member

Description

SetMember updates the specified member in the object. Member names are case-insensitive. SetMember can be used to update members with a dynamically generated name.

If the member does not exist in @italic obj, or @italic newvalue is of an incompatible type, an error is generated.

Examples

// Retrieve a file object, and add exclamation points to its title
OBJECT myfile := FindFile(15);
myfile := MemberUpdate(myfile, "title", myfile.title || "!!!");