getAtKey

getAtKey(keys: KeyType): MemberType;

The getAtKey method of the Dictionary class returns a reference to an object in the receiver collection at the specified key value.

If an entry with the key specified in the keys parameter is not found, this method returns a null value.

The following examples show the use of the getAtKey method.

cust := custNameDict.getAtKey("Jones", "11 Any Road", customer);

delete() updating;
vars
    fault : Fault;
begin
    foreach fault in app.myCompany.allFaults do
        if fault.myCustomer = self and f.closedDate = null then
            fault.myCustomer := app.myCompany.allCustomers.getAtKey("Deleted
                            Customers").Customer;
        endif;
    endforeach;
end;

The code fragments in the following examples show the use of the bracket ([]) subscript operators to assign values to a dictionary.

cust := custNameDict["Jones", "11 Any Road", customer];

cust := custNameDict[custName];