MAP::EXIST 1g 2023-11-19 laplante@plcb.ca GOWEB/MAP


title: “MAP::EXIST Function” author: “Pierre Laplante laplante@plcb.ca” date: “2023-11-19” version: “1.0.0” section: “1g”

category: “GOWEB/MAP”

Name

map::exist checks whether a specified string is defined as a key within a given map.

Synopsis

map::exist(map, key: string)

Description

The map::exist function checks whether a specified string is defined as a key within a given map.
It returns true if the key exists and false otherwise.

This function is useful for verifying the presence of keys before attempting to access their values, thereby preventing errors when dealing with undefined keys.

Examples

res={{
    x := { "errcode" : 0 };

    map::exist(x, "errcode");   // returns true
    map::exist(x, "xerrcode");  // returns false
}}.

res=truefalse.

Author

Pierre Laplante laplante@plcb.ca

See also

Version