MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / GetEnumItem

Method GetEnumItem

source/script_object.cpp:2048–2077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2046
2047
2048ResultType Array::GetEnumItem(UINT &aIndex, Var *aVal, Var *aReserved, int aVarCount)
2049{
2050 if (aIndex < mLength)
2051 {
2052 if (aVarCount > 1)
2053 {
2054 // Put the index first, only when there are two parameters.
2055 if (aVal)
2056 aVal->Assign((__int64)aIndex + 1);
2057 aVal = aReserved;
2058 }
2059 if (aVal)
2060 {
2061 auto &item = mItem[aIndex];
2062 switch (item.symbol)
2063 {
2064 default:
2065 aVal->AssignString(item.string, item.string.Length());
2066 if (item.symbol == SYM_MISSING)
2067 aVal->MarkUninitialized();
2068 break;
2069 case SYM_INTEGER: aVal->Assign(item.n_int64); break;
2070 case SYM_FLOAT: aVal->Assign(item.n_double); break;
2071 case SYM_OBJECT: aVal->Assign(item.object); break;
2072 }
2073 }
2074 return CONDITION_TRUE;
2075 }
2076 return CONDITION_FALSE;
2077}
2078
2079
2080

Callers

nothing calls this directly

Calls 5

AssignStringMethod · 0.80
MarkUninitializedMethod · 0.80
AssignMethod · 0.45
LengthMethod · 0.45
ToTokenMethod · 0.45

Tested by

no test coverage detected