lynx_value_get_array_length

Introduction

Read the length of array from lynx_value.

Syntax

lynx_api_status lynx_value_get_array_length(lynx_api_env env,
                                            lynx_value value,
                                            uint32_t* result);

Parameters

KeyDescription
[in] envThe environment in which lynx value runs, typically nullptr.
[in] valuelynx_value representing array.
[out] resultuint32 representing length of the array.

Return Value

Returns lynx_api_ok if the API succeeded. Returns lynx_api_array_expected if the types do not match.

Example

uint32_t len;
lynx_api_status status =  lynx_value_get_array_length(env, value, &len);
if (status != lynx_api_ok) {
  // handle error.
}
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.