ホーム › Globalization › CURRENCYFMTA
CURRENCYFMTA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NumDigits | DWORD | 4 | +0 | +0 | 小数点以下の桁数を指定する。 |
| LeadingZero | DWORD | 4 | +4 | +4 | 1未満のとき先頭にゼロを付けるか。0=付けない、1=付ける。 |
| Grouping | DWORD | 4 | +8 | +8 | 整数部の桁区切りグルーピング指定。 |
| lpDecimalSep | LPSTR | 8/4 | +16 | +12 | 小数点記号の文字列(ANSI)。 |
| lpThousandSep | LPSTR | 8/4 | +24 | +16 | 桁区切り記号の文字列(ANSI)。 |
| NegativeOrder | DWORD | 4 | +32 | +20 | 負の通貨額の表示形式を示す番号(0〜15)。 |
| PositiveOrder | DWORD | 4 | +36 | +24 | 正の通貨額の表示形式を示す番号(0〜3)。 |
| lpCurrencySymbol | LPSTR | 8/4 | +40 | +28 | 通貨記号の文字列(ANSI)。 |
各言語での定義
#include <windows.h>
// CURRENCYFMTA (x64 48 / x86 32 バイト)
typedef struct CURRENCYFMTA {
DWORD NumDigits;
DWORD LeadingZero;
DWORD Grouping;
LPSTR lpDecimalSep;
LPSTR lpThousandSep;
DWORD NegativeOrder;
DWORD PositiveOrder;
LPSTR lpCurrencySymbol;
} CURRENCYFMTA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CURRENCYFMTA
{
public uint NumDigits;
public uint LeadingZero;
public uint Grouping;
public IntPtr lpDecimalSep;
public IntPtr lpThousandSep;
public uint NegativeOrder;
public uint PositiveOrder;
public IntPtr lpCurrencySymbol;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CURRENCYFMTA
Public NumDigits As UInteger
Public LeadingZero As UInteger
Public Grouping As UInteger
Public lpDecimalSep As IntPtr
Public lpThousandSep As IntPtr
Public NegativeOrder As UInteger
Public PositiveOrder As UInteger
Public lpCurrencySymbol As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class CURRENCYFMTA(ctypes.Structure):
_fields_ = [
("NumDigits", wintypes.DWORD),
("LeadingZero", wintypes.DWORD),
("Grouping", wintypes.DWORD),
("lpDecimalSep", ctypes.c_void_p),
("lpThousandSep", ctypes.c_void_p),
("NegativeOrder", wintypes.DWORD),
("PositiveOrder", wintypes.DWORD),
("lpCurrencySymbol", ctypes.c_void_p),
]#[repr(C)]
pub struct CURRENCYFMTA {
pub NumDigits: u32,
pub LeadingZero: u32,
pub Grouping: u32,
pub lpDecimalSep: *mut core::ffi::c_void,
pub lpThousandSep: *mut core::ffi::c_void,
pub NegativeOrder: u32,
pub PositiveOrder: u32,
pub lpCurrencySymbol: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type CURRENCYFMTA struct {
NumDigits uint32
LeadingZero uint32
Grouping uint32
lpDecimalSep uintptr
lpThousandSep uintptr
NegativeOrder uint32
PositiveOrder uint32
lpCurrencySymbol uintptr
}type
CURRENCYFMTA = record
NumDigits: DWORD;
LeadingZero: DWORD;
Grouping: DWORD;
lpDecimalSep: Pointer;
lpThousandSep: Pointer;
NegativeOrder: DWORD;
PositiveOrder: DWORD;
lpCurrencySymbol: Pointer;
end;const CURRENCYFMTA = extern struct {
NumDigits: u32,
LeadingZero: u32,
Grouping: u32,
lpDecimalSep: ?*anyopaque,
lpThousandSep: ?*anyopaque,
NegativeOrder: u32,
PositiveOrder: u32,
lpCurrencySymbol: ?*anyopaque,
};type
CURRENCYFMTA {.bycopy.} = object
NumDigits: uint32
LeadingZero: uint32
Grouping: uint32
lpDecimalSep: pointer
lpThousandSep: pointer
NegativeOrder: uint32
PositiveOrder: uint32
lpCurrencySymbol: pointerstruct CURRENCYFMTA
{
uint NumDigits;
uint LeadingZero;
uint Grouping;
void* lpDecimalSep;
void* lpThousandSep;
uint NegativeOrder;
uint PositiveOrder;
void* lpCurrencySymbol;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CURRENCYFMTA サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; NumDigits : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; LeadingZero : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Grouping : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpDecimalSep : LPSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpThousandSep : LPSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; NegativeOrder : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; PositiveOrder : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; lpCurrencySymbol : LPSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CURRENCYFMTA サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; NumDigits : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; LeadingZero : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Grouping : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpDecimalSep : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpThousandSep : LPSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; NegativeOrder : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; PositiveOrder : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; lpCurrencySymbol : LPSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CURRENCYFMTA
#field int NumDigits
#field int LeadingZero
#field int Grouping
#field intptr lpDecimalSep
#field intptr lpThousandSep
#field int NegativeOrder
#field int PositiveOrder
#field intptr lpCurrencySymbol
#endstruct
stdim st, CURRENCYFMTA ; NSTRUCT 変数を確保
st->NumDigits = 100
mes "NumDigits=" + st->NumDigits