Win32 API 日本語リファレンス
ホームSystem.Ole › NUMPARSE

NUMPARSE

構造体
サイズx64: 24 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cDigINT4+0+0入力時は配列のサイズを指定します。出力時は rgbDig 配列に書き込まれた項目数が格納されます。
dwInFlagsNUMPARSE_FLAGS4+4+4

入力フラグです。

NUMPRS_CURRENCY (0x0400)

NUMPRS_DECIMAL (0x0100)

NUMPRS_EXPONENT (0x0800)

NUMPRS_HEX_OCT (0x0040)

NUMPRS_LEADING_MINUS (0x0100)

NUMPRS_LEADING_PLUS (0x0004)

NUMPRS_LEADING_WHITE (0x0001)

NUMPRS_PARENS (0x0080)

NUMPRS_STD (0x1FFF)

NUMPRS_THOUSANDS (0x0200)

NUMPRS_TRAILING_MINUS (0x0020)

NUMPRS_TRAILING_PLUS (0x0008)

NUMPRS_TRAILING_WHITE (0x0002)

NUMPRS_USE_ALL (0x1000)

dwOutFlagsNUMPARSE_FLAGS4+8+8

出力フラグです。dwInFlags のすべての値に加えて、次の値が含まれます。

NUMPRS_INEXACT (0x20000)

NUMPRS_NEG (0x10000)

cchUsedINT4+12+12解析に成功した文字数 (文字列の先頭からの文字数) を受け取ります。
nBaseShiftINT4+16+161 桁あたりのビット数です (8 進数と 16 進数の場合は 3 または 4、10 進数の場合は 0)。
nPwr10INT4+20+20小数点の位置です。

公式ドキュメント

数値の解析情報を指定します。

解説(Remarks)

次の内容は 10 進数にのみ適用されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// NUMPARSE  (x64 24 / x86 24 バイト)
typedef struct NUMPARSE {
    INT cDig;
    NUMPARSE_FLAGS dwInFlags;
    NUMPARSE_FLAGS dwOutFlags;
    INT cchUsed;
    INT nBaseShift;
    INT nPwr10;
} NUMPARSE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NUMPARSE
{
    public int cDig;
    public uint dwInFlags;
    public uint dwOutFlags;
    public int cchUsed;
    public int nBaseShift;
    public int nPwr10;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NUMPARSE
    Public cDig As Integer
    Public dwInFlags As UInteger
    Public dwOutFlags As UInteger
    Public cchUsed As Integer
    Public nBaseShift As Integer
    Public nPwr10 As Integer
End Structure
import ctypes
from ctypes import wintypes

class NUMPARSE(ctypes.Structure):
    _fields_ = [
        ("cDig", ctypes.c_int),
        ("dwInFlags", wintypes.DWORD),
        ("dwOutFlags", wintypes.DWORD),
        ("cchUsed", ctypes.c_int),
        ("nBaseShift", ctypes.c_int),
        ("nPwr10", ctypes.c_int),
    ]
#[repr(C)]
pub struct NUMPARSE {
    pub cDig: i32,
    pub dwInFlags: u32,
    pub dwOutFlags: u32,
    pub cchUsed: i32,
    pub nBaseShift: i32,
    pub nPwr10: i32,
}
import "golang.org/x/sys/windows"

type NUMPARSE struct {
	cDig int32
	dwInFlags uint32
	dwOutFlags uint32
	cchUsed int32
	nBaseShift int32
	nPwr10 int32
}
type
  NUMPARSE = record
    cDig: Integer;
    dwInFlags: DWORD;
    dwOutFlags: DWORD;
    cchUsed: Integer;
    nBaseShift: Integer;
    nPwr10: Integer;
  end;
const NUMPARSE = extern struct {
    cDig: i32,
    dwInFlags: u32,
    dwOutFlags: u32,
    cchUsed: i32,
    nBaseShift: i32,
    nPwr10: i32,
};
type
  NUMPARSE {.bycopy.} = object
    cDig: int32
    dwInFlags: uint32
    dwOutFlags: uint32
    cchUsed: int32
    nBaseShift: int32
    nPwr10: int32
struct NUMPARSE
{
    int cDig;
    uint dwInFlags;
    uint dwOutFlags;
    int cchUsed;
    int nBaseShift;
    int nPwr10;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NUMPARSE サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cDig : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwInFlags : NUMPARSE_FLAGS (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwOutFlags : NUMPARSE_FLAGS (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cchUsed : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; nBaseShift : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; nPwr10 : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NUMPARSE
    #field int cDig
    #field int dwInFlags
    #field int dwOutFlags
    #field int cchUsed
    #field int nBaseShift
    #field int nPwr10
#endstruct

stdim st, NUMPARSE        ; NSTRUCT 変数を確保
st->cDig = 100
mes "cDig=" + st->cDig