GETMEMBER()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to return the value of a dynamic array element or an alternative value if the element does not exist

Syntax

GETMEMBER(<expC1>, <expC2>, <expC3>)

See Also

AADD(), AAVERAGE(), ACOPY(), ADEL(), ADESC(), ADIR(), AELEMENT(), AFIELDS(), AFILL(), AINS(), ALEN(), AMAX(), AMIN(), APPEND FROM ARRAY, ASIZE(), ASORT(), ASTORE(), ASTRING(), ASUBSCRIPT(), ASUM(), COPY TO ARRAY, DECLARE, DIMENSION, FUNCTION, GATHER, GETPARAMETER(), GETSESSIONVAR(), IN_ARRAY(), IS_ARRAY(), LOCAL, NAMESPACE, NAMESPACE(), PARAMETERS, PARAMETERS(), PCOUNT(), PRIVATE, PUBLIC, RELEASE, RESTORE, SAVE, SCATTER, SET EXACT, ARRAY()

Description

The GETMEMBER() function is used return the value of a dynamic array element or an alternative value if the element does not exist. The name of the array is specified in <expC1>. The name of the element to return is specified in <expC2>. An alternative value is specified in <expC3> and this will be returned if the element does not exist.

Example

tab = array("day" => "Monday", "month" => "May")
// Return "2014" if no 'year' element exists
? getmember("tab","year","2014")