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

# AddStatusValueToMsg

### int AddStatusValueToMsg(int lMsgId, int SVID)

현재 작성 중인 메시지에 특정 SVID(Status Variable ID)의 현재 값을 자동으로 추가합니다. 단순한  값뿐만 아니라, 해당 SVID가 \*\*배열(Array)이나 구조형(List/Object)\*\*으로 정의되어 있어도 라이브러리 내부에서 그 구조를 유지한 채 그대로 메시지에 삽입합니다.

Parameters

<table data-header-hidden><thead><tr><th width="221" valign="top"></th><th width="102" 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">SVID</td><td valign="top">int</td><td valign="top">추가할 VID</td></tr></tbody></table>

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

 m_gem.OpenListItem(lMsgId);
   m_gem.AddAsciiItem(lMsgId, "PPID_01", 7);
   m_gem.AddU4Item(lMsgId, 3);
   m_gem.AddStatusValueToMsg(lMsgId, 2001);//값 3
   m_gem.AddStatusValueToMsg(lMsgId, 4001);//오브젝트형 VID
   m_gem.AddStatusValueToMsg(lMsgId, 4002);//오브젝트형 VID
 m_gem.CloseListItme(lMsgId);
 m_gem.SendMsg(lMsgId);
```

GEM 로그는 하기와 같이 기록됩니다.

```
	<S6F11W
		   <L[5/1]
		      <A[7/1] 'PPID_01'>	//m_gem.AddAsciiItem(lMsgId, "PPID_01", 7);
		      <U4[1/1] 3>					//m_gem.AddU4Item(lMsgId, 3);
		      <U1[1/1] 3>					//m_gem.AddStatusValueToMsg(lMsgId, 2001);//값 3
		      <L[1/1]							//m_gem.AddStatusValueToMsg(lMsgId, 4001);//오브젝트형 VID
		         <L[2/1]
		            <I4[1/1] 3>
		            <I4[1/1] 1>
		         >
		      >
		      <L[1/1]						//m_gem.AddStatusValueToMsg(lMsgId, 4002);//오브젝트형 VID
		         <L[3/1]
		            <I4[1/1] 60>
		            <I4[1/1] 0>
		            <L[4/1]
		               <I4[1/1] 10>
		               <I4[1/1] 10>
		               <I4[1/1] 10>
		               <I4[1/1] 10>
		            >
		         >
		      >
		   >
		>
```


---

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