# AddListItem

### int AddListItem(int lMsgId, int lSubitemCount)

메시지 작성 중 List(L) 타입의 아이템을 추가합니다. 이 함수는 리스트의 시작(Open)과 끝(Close)을 관리하며, 설정된 lSubitemCount만큼 하위 아이템(Add\_\_\_Item 계열 함수 호출)이 추가되면 자동으로 리스트를 닫아줍니다.

{% hint style="info" %}
AddlistItem을 반복해서 사용은 불가합니다.(한번에 하나의 AddListItem 사용)
{% endhint %}

Parameters

<table data-header-hidden><thead><tr><th width="216" valign="top"></th><th width="130" 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">작성중인 메시지의 고유 ID</td></tr><tr><td valign="top">lSubitemCount</td><td valign="top">int</td><td valign="top">추가할 Item의 수</td></tr></tbody></table>

&#x20;

```csharp
int msgId = m_gem.CreateMsg(6,11,1);

// 1. 2개의 하위 아이템을 가진 리스트 생성 (L, 2)
m_gem.AddListItem(msgId, 2);

// 2. 리스트의 첫 번째 아이템 추가 (ASCII)
m_gem.AddAsciiItem(msgId, "COMMAND_01",10);

// 3. 리스트의 두 번째 아이템 추가 (UINT4)
uint status = 1;
m_gem.AddU4Item(msgId, ref status);

// 결과적으로 <L [2] <A "COMMAND_01"> <U4 1>> 구조가 생성됨
//<L
    //<A ""COMMAND_01">
    //<U4 1>
//>
```


---

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