System.JSON.TJSONArray.TEnumerator

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

TEnumerator = class

C++

class PASCALIMPLEMENTATION TEnumerator : public System::TObject

Properties

Type Visibility Source Unit Parent
class public
System.JSON.pas
System.JSON.hpp
System.JSON TJSONArray

Description

Iterator for items of JSON arrays.

To use an iterator to iterate a TJSONArray object, call GetEnumerator from the JSON array object to create a TEnumerator iterator, and use MoveNext and Current to iterate through the JSON values of the JSON array:

Delphi:

MyJSONArrayIterator := TEnumerator.Create(MyJSONArray);
while MyJSONArrayIterator.MoveNext do
begin
    MyJSONValue := MyJSONArrayIterator.Current;
    // …
end;

C++:

TEnumerator* MyJSONArrayIterator = new TEnumerator(MyJSONArray);
while (MyJSONArrayIterator->MoveNext())
{
    TJSONValue* MyJSONValue = MyJSONArrayIterator->Current;
    // …
}

See Also