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

# GetItemInfo

### public unsafe int GetItemInfo(int lMsgId, string sPointer, ref int nFormat, ref int lSize)

수신된 메시지(`lMsgId`) 내에서 특정 경로(`sPointer`)가 가리키는 데이터 아이템의 Format Code(데이터 타입)와 Size(데이터 길이 또는 리스트의 요소 개수)를 조회합니다. 데이터를 실제로 읽기(`GetItemValue`) 전에 버퍼를 준비하거나 데이터 유효성을 검사하는 용도로 필수적인 함수입니다.

Parameters

<table data-header-hidden><thead><tr><th width="158"></th><th width="95"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td>lMsgId</td><td>int</td><td>조회할 대상 메시지 ID</td></tr><tr><td>sPointer</td><td>string</td><td>"/ "이면 List<br>"1"이면 첫번째 아이템<br>"2"이면 두번째 아이템</td></tr><tr><td>nFormat</td><td>ref int</td><td>(Output) 데이터의 Format Code (예: List=0, ASCII=16, U4=12 등)</td></tr><tr><td>lSize</td><td>ref int</td><td>(Output) 데이터의 크기 (ASCII는 문자열 길이, List는 요소 개수)</td></tr></tbody></table>

{% code title="Host에서 보낸 메시지 예시" %}

```
S2F33W   /* DEFINE REPORT */
<L
   <U2 1>
   <L
      <L
         <U2 1004>
         <L
            <U4 2001>
            <U4 2003>
            <U4 2009>
         >
      >
   >
>

```

{% endcode %}

```csharp
void ParseMessageItem(int lMsgId)
{
    int nFormat= 0;
    int nSize= 0;
    
    // U4 2001의 Format과 Size를 얻고싶은경우
    m_gem.GetItemInfo(lMsgId, "/2/1/2/1", ref nFormat, ref nSize);//54(U4) 가 나오게 됩니다.

    if (result >= 0)
    {
        Console.WriteLine($"아이템 포맷: {format}, 크기/개수: {size}");
        
        if (nFormat== 0) // List 타입인 경우
        {
             Console.WriteLine($"해당 위치는 {size}개의 요소를 가진 리스트입니다.");
        }
    }
}
```

<table data-header-hidden><thead><tr><th valign="top"></th><th width="178" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Item Format</td><td valign="top">Value</td><td valign="top">Description</td></tr><tr><td valign="top">L</td><td valign="top">0</td><td valign="top">LIST ITEM</td></tr><tr><td valign="top">B</td><td valign="top">10</td><td valign="top">BINARY ITEM</td></tr><tr><td valign="top">BOOL</td><td valign="top">11</td><td valign="top">BOOLEAN ITEM</td></tr><tr><td valign="top">A</td><td valign="top">20</td><td valign="top">ASCII ITEM</td></tr><tr><td valign="top">J8</td><td valign="top">21</td><td valign="top">JIS-8 Byte ITEM</td></tr><tr><td valign="top">I1</td><td valign="top">31</td><td valign="top">1 Byte Signed Integer</td></tr><tr><td valign="top">I2</td><td valign="top">32</td><td valign="top">2Byte Signed Integer</td></tr><tr><td valign="top">I4</td><td valign="top">34</td><td valign="top">4 Byte Signed Integer</td></tr><tr><td valign="top">I8</td><td valign="top">30</td><td valign="top">8 Byte Signed Integer</td></tr><tr><td valign="top">U1</td><td valign="top">51</td><td valign="top">1 Byte Unsigned Integer</td></tr><tr><td valign="top">U2</td><td valign="top">52</td><td valign="top">2 Byte Unsigned Integer</td></tr><tr><td valign="top">U4</td><td valign="top">54</td><td valign="top">4 Byte Unsigned Integer</td></tr><tr><td valign="top">U8</td><td valign="top">50</td><td valign="top">8 Byte Unsigned Integer</td></tr><tr><td valign="top">F4</td><td valign="top">44</td><td valign="top">4 Byte Floating Pointer</td></tr><tr><td valign="top">F8</td><td valign="top">40</td><td valign="top">8 Byte Floating Pointer</td></tr><tr><td valign="top">NO ITEM</td><td valign="top">-1</td><td valign="top">더 이상 Item이 존재하지 않음</td></tr></tbody></table>


---

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