> 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/getsubitemcount.md).

# GetSubItemCount

### int GetSubItemCount(int lMsgId)

수신한 SECS 메시지에서 현재 가리키고 있는 아이템의 형식이 \*\*List(L)\*\*일 경우, 해당 List에 포함된 하위 아이템(Sub-item)의 개수를 반환합니다.

{% hint style="info" %}
GetListItemOpen()과의 차이

GetSubItemCount()는 현재 List안의 수량만 파악합니다.

GetListItemOpen()은 현재 List안의 수량을 파악하고 List를 열고 포인터는 다음 아이템으로 가게 됩니다.
{% endhint %}

Parameters

<table data-header-hidden><thead><tr><th width="214" valign="top"></th><th width="114" 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>

Return Value

<table data-header-hidden><thead><tr><th width="216" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Value</td><td valign="top">Description</td></tr><tr><td valign="top">>=0</td><td valign="top">subitem count</td></tr><tr><td valign="top">&#x3C;0</td><td valign="top">실패 (Error Code 반환) Error Code는 Error Code List를 참조</td></tr></tbody></table>

```csharp
//현재 메시지에서 하위 아이템 개수 확인
int subCount = m_gem.GetSubItemCount(lMsgId);
```


---

# 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/getsubitemcount.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.
