Data.FmtBcd.TBcd

Aus RAD Studio API Documentation
Wechseln zu: Navigation, Suche

Delphi

  TBcd  = record
    Precision: Byte;                        { 1..64 }
    SignSpecialPlaces: Byte;                { Sign:1, Special:1, Places:6 }
    Fraction: packed array [0..31] of Byte; { BCD Nibbles, 00..99 per Byte, high Nibble 1st }
    class operator Implicit(const str: string): TBcd;
    class operator Implicit(const d: double): TBcd;
    class operator Implicit(const I: Integer): TBcd;
    class operator Explicit(const ABcd: TBcd): string;
    class operator Explicit(const ABcd: TBcd): Integer;
    class operator Add(const A, B: TBcd): TBcd;
    class operator Subtract(const A, B: TBcd): TBcd;
    class operator Multiply(const A, B: TBcd): TBcd;
    class operator Divide(const A, B: TBcd): TBcd;
    class operator Negative(const A: TBcd): TBcd;
    class operator Equal(const A, B: TBcd): Boolean;
    class operator NotEqual(const A, B: TBcd): Boolean;
    class operator GreaterThan(const A, B: TBcd): Boolean;
    class operator LessThan(const A, B: TBcd): Boolean;
    class operator GreaterThanOrEqual(const A, B: TBcd): Boolean;
    class operator LessThanOrEqual(const A, B: TBcd): Boolean;
  end;

C++

struct DECLSPEC_DRECORD TBcd
{
public:
    System::Byte Precision;
    System::Byte SignSpecialPlaces;
    System::StaticArray<System::Byte, 32> Fraction;
    static TBcd __fastcall _op_Implicit(const System::UnicodeString str);
    TBcd& __fastcall operator=(const System::UnicodeString str) { *this = TBcd::_op_Implicit(str); return *this; };
    static TBcd __fastcall _op_Implicit(const double d);
    TBcd& __fastcall operator=(const double d) { *this = TBcd::_op_Implicit(d); return *this; };
    static TBcd __fastcall _op_Implicit(const int I);
    TBcd& __fastcall operator=(const int I) { *this = TBcd::_op_Implicit(I); return *this; };
    static TBcd __fastcall _op_Addition(const TBcd &A, const TBcd &B);
    TBcd __fastcall operator+(const TBcd& __rhs) { return TBcd::_op_Addition(*this, __rhs); };
    static TBcd __fastcall _op_Subtraction(const TBcd &A, const TBcd &B);
    TBcd __fastcall operator-(const TBcd& __rhs) { return TBcd::_op_Subtraction(*this, __rhs); };
    static TBcd __fastcall _op_Multiply(const TBcd &A, const TBcd &B);
    TBcd __fastcall operator*(const TBcd& __rhs) { return TBcd::_op_Multiply(*this, __rhs); };
    static TBcd __fastcall _op_Division(const TBcd &A, const TBcd &B);
    TBcd __fastcall operator/(const TBcd& __rhs) { return TBcd::_op_Division(*this, __rhs); };
    static TBcd __fastcall _op_UnaryNegation(const TBcd &A);
    TBcd __fastcall operator-() { return TBcd::_op_UnaryNegation(*this); };
    static bool __fastcall _op_Equality(const TBcd &A, const TBcd &B);
    bool __fastcall operator==(const TBcd& __rhs) { return TBcd::_op_Equality(*this, __rhs); };
    static bool __fastcall _op_Inequality(const TBcd &A, const TBcd &B);
    bool __fastcall operator!=(const TBcd& __rhs) { return TBcd::_op_Inequality(*this, __rhs); };
    static bool __fastcall _op_GreaterThan(const TBcd &A, const TBcd &B);
    bool __fastcall operator>(const TBcd& __rhs) { return TBcd::_op_GreaterThan(*this, __rhs); };
    static bool __fastcall _op_LessThan(const TBcd &A, const TBcd &B);
    bool __fastcall operator<(const TBcd& __rhs) { return TBcd::_op_LessThan(*this, __rhs); };
    static bool __fastcall _op_GreaterThanOrEqual(const TBcd &A, const TBcd &B);
    bool __fastcall operator>=(const TBcd& __rhs) { return TBcd::_op_GreaterThanOrEqual(*this, __rhs); };
    static bool __fastcall _op_LessThanOrEqual(const TBcd &A, const TBcd &B);
    bool __fastcall operator<=(const TBcd& __rhs) { return TBcd::_op_LessThanOrEqual(*this, __rhs); };
};

Eigenschaften

Typ Sichtbarkeit Quelle Unit Übergeordnet
record
struct
public
Data.FmtBcd.pas
Data.FMTBcd.hpp
Data.FmtBcd Data.FmtBcd

Beschreibung

TBcd speichert einen binärcodierten Dezimalwert.

TBcd repräsentiert einen binärcodierten Dezimalwert. Er enthält die folgenden Felder:



Feld Inhalt

Genauigkeit

Die Anzahl der Zeichen in der Dezimalversion des Wertes.

SignSpecialPlaces

Das Vorzeichen-Bit (0 ist positiv, allen anderen Werte sind negativ).

Fraction

Array mit BCD-Nibbles, 00 bis 99 pro Byte, oberes Nibble zuerst. Nur die erste in Precision angegebene Anzahl von Nibbles wird verwendet.



Sie können mit der Funktion VarFMTBcdCreate eine Variante erstellen, die einen TBcd-Wert repräsentiert. Tatsächlich stellt dies den einfachsten Weg zur Bearbeitung von TBcd-Werten dar, da dann die integrierten Operatoren des Typs Variant genutzt werden können.

Siehe auch