お知らせ

電子会議

ライブラリ

パレット

Delphi FAQ検索

Delphi FAQ一覧

サンプル蔵





FDelphi FAQ
16番会議室「玉石混淆みんなで作るSample蔵」に寄せられたサンプル

"16進数←→整数/実数型変換 関数集"




こんにちわ、みなさん

16進数←→整数/実数型変換の関数集ユニット(HexUtils.lzh)をライブラリの
#12 "Delphi関連ファイル (DLL, VBX, OCX 等)"へアップしました。

Sample蔵にアップしたかったのですが 500行にもなってしまったので
ライブラリにアップする事にしました。

また、C言語の共有体?のUnionのSampleにもなっています。

使用できる関数は、下記のとうり
    function ByteToBinary(bt: Byte): string;
    function ByteToHex(bt: Byte): string;
    function BinaryToByte(Bin: string): Byte;
    function HexToByte(Bin: string): Byte;
    function BinaryToHex(Bin: string): string;
    function HexToBinary(Hex: string): string;
    function ChangeEgg(Hex: string): string;
    function ShortintToHex(si: Shortint): string;
    function HexToShortint(st: string): Shortint;
    function SmallintToHex(sm: Smallint): string;
    function HexToSmallint(st: string): Smallint;
    function WordToHex(wd: Word): string;
    function HexToWord(st: string): Word;
    function LongintToHex(lg: Longint): string;
    function HexToLongint(st: string): Longint;
    function SingleToHex(sg: Single): string;
    function HexToSingle(st: string): Single;
    function RealToHex(rl: Real): string;
    function HexToReal(st: string): Real;
    function DoubleToHex(db: Double): string;
    function HexToDouble(st: string): Double;
    function CompToHex(cm: Comp): string;
    function HexToComp(st: string): Comp;
    function CurrencyToHex(cr: Currency): string;
    function HexToCurrency(st: string): Currency;
    function ExtendedToHex(ex: Extended): string;
    function HexToExtended(st: string): Extended;

HexTo系は、おおよそのエラー処理しかできていません。

by むすす

Original document by むすす          氏 ID:(BYH12101)


ここにあるドキュメントは NIFTY SERVEの Delphi Users' Forum の16番会議室「玉石混淆みんなで作るSample蔵」に投稿されたサンプルです。これらのサンプルはボーランド株式会社がサポートする公式のものではありません。また、必ずしも動作が検証されているものではありません。これらのサンプルを使用したことに起因するいかなる損害も投稿者、およびフォーラムスタッフはその責めを負いません。使用者のリスクの範疇でご使用下さい。

Copyright 1996-2002 Delphi Users' Forum