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

# AddJ8Item

#### int AddJ8Item(int lMsgId, string strValue, int lCount)

메시지 작성시 JIS-8 문자열을 원하는 길이로 추가해주는 함수.

입력 문자열(strValue)의 길이보다 큰 lCount 입력 시 나머지는 공백으로 추가해주고, 작은 lCount 입력 시 문자열의 앞부터 정해진 lCount 만큼의 문자만 메시지에 추가합니다.

Parameters

<table data-header-hidden><thead><tr><th width="161" valign="top"></th><th width="145" 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">strValue</td><td valign="top">string</td><td valign="top">추가할 JIS-8문자열</td></tr><tr><td valign="top">lCount</td><td valign="top">int</td><td valign="top">추가할 문자열의 길이</td></tr></tbody></table>

```csharp
// 1. 추가할 일본어 문자열 준비
    string strJapaneseMsg = "半導体装置"; // "반도체 장치"의 일본어 한자
    
    // 2. 문자열의 문자 수(Length) 계산
    int nStrLen = strJapaneseMsg.Length;

    // 3. AddJ8Item 호출
    // lMsgId: 메시지 고유 ID, strValue: 문자열 내용, lCount: 문자 개수
    int nResult = m_gem.AddJ8Item(lMsgId, strJapaneseMsg, nStrLen);

    // 4. 결과 확인
    if (nResult == 0)
    {
        Console.WriteLine("JIS-8 아이템 추가 성공");
    }
    else
    {
        // 실패 시 에러 코드 확인 
        Console.WriteLine($"JIS-8 아이템 추가 실패. 에러 코드: {nResult}");
    }
```


---

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