> For the complete documentation index, see [llms.txt](https://nviasoft.gitbook.io/nviasoft-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nviasoft.gitbook.io/nviasoft-docs/api-reference/item-parsing/getlistitem.md).

# GetListItem

### int GetListItem(int lMsgId)

수신한 SECS 메시지의 Sub Item을 읽기 위해 List Item을 열고 닫음.

Sub Item을 모두 읽고 나면 자동으로 List를 Close 해줍니다.

Parameters

<table data-header-hidden><thead><tr><th width="198" valign="top"></th><th width="113" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Name</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">lMsgId</td><td valign="top">int</td><td valign="top">수신한 Message의 ID</td></tr></tbody></table>

```csharp
    // 1. GetListItem 호출하여 리스트 진입 및 개수 파악
    int nItemCount = m_gem.GetListItem(lMsgId);

    if (nItemCount >= 0)
    {
        Console.WriteLine($"리스트 진입 성공. 내부 항목 개수: {nItemCount}");

        // 2. 반환된 개수만큼 반복하며 내부 아이템 읽기
        for (int i = 0; i < nItemCount; i++)
        {
            string strValue = "";
            // GetItem 등 포맷에 맞는 함수로 데이터 추출
            m_gem.GetItem(lMsgId, ref strValue);
            Console.WriteLine($"[{i}]번째 데이터: {strValue}");
        }
        
        // 모든 아이템을 읽으면 엔진이 자동으로 List를 Close함
    }
    else
    {
        Console.WriteLine($"리스트 읽기 실패. 에러 코드: {nItemCount}");
    }
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nviasoft.gitbook.io/nviasoft-docs/api-reference/item-parsing/getlistitem.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
