メンバ一覧 WrpInteger 前のコンストラクタ 次のコンストラクタ

VB C# ALL プログラミング言語によるフィルタ (ここで選んだ言語で選別された説明や図だけが表示されます)

WrpInteger コンストラクタ

機能および役割

パラメタで指定された値の WrpInteger オブジェクトのインスタンスを生成 (コンストラクト) する。

なお、WrpInteger は (Integer, int) のラッパーオブジェクトであり、空の値 (Nothing, null) を設定することができる。 空の値は、項目が空欄であることを表現するために用いることができる。

所属クラス (ツーピーススタイルの場合にこのコンストラクタが宣言されているクラス)

AppliTech.WorkFrame.WrpInteger (ローカル)

AppliTech.WorkFrame.WrpInteger (セントラル)

または AppliTech.WrpObject8.dll の中の以下のクラスにも含まれている。

AppliTech.WrpInteger (ローカル・セントラル共通)

呼出し方

VB での書き方:
 New WrpInteger(整数値)

C# での書き方:
 new WrpInteger(整数値)

Java での書き方:
 new WrpInteger(整数値)

戻り値の型および意味

WrpInteger 型

パラメタの型および意味

整数値型 (Integer, int)

または

文字列型 (String, string)

例外の発生 (誤った呼出しの際に発生する例外)

「パラメタの文字列を整数値に変換できません (WrpInteger)」

使用上のヒントと注意事項

この WrpInteger 型を用いると、空の値とゼロを区別することができる。

このコンストラクタではなく、メソッド valueOf を使用することをお勧めする。

関連事項

VB 6.0 には Variant という型があり、Null 値を指定できたが、それと同様に WrpInteger 型では空の値 (Nothing, null) を設定することのできる。

Java のラッパーオブジェクト Integer にほぼ相当する。

使用例

' Visual Basic による New WrpInteger の例
Private Function TransferFromDb(ByVal fB As FormBase) As Integer
    ' 画面項目にデータを転送します。
    fB.setValue(SampManFormBase.ii_Campaign, _
                New WrpBoolean(currentCommodity.GetCampaign()))
    fB.setValue(SampManFormBase.ii_CampaignCode, _
                currentCommodity.GetCampaignCode())
    fB.setValue(SampManFormBase.ii_SizeCode, _
                New WrpInteger(currentCommodity.GetSizeCode()))
    fB.setValue(SampManFormBase.ii_CommodityClassCode, _
                New WrpInteger(currentCommodity.GetClassCode()))
    fB.setValue(SampManFormBase.ii_StandardUnitPrice, _
                New WrpDecimal(currentCommodity.GetStandardUnitPrice()))
    Return 1
End Function
// C# による new WrpInteger の例
private int TransferFromDb( FormBase fB ) {
    // 画面項目にデータを転送します。
    fB.setValue(SampManFormBase.ii_Campaign,
                new WrpBoolean(currentCommodity.GetCampaign()));
    fB.setValue(SampManFormBase.ii_CampaignCode,
                currentCommodity.GetCampaignCode());
    fB.setValue(SampManFormBase.ii_SizeCode,
                new WrpInteger(currentCommodity.GetSizeCode()));
    fB.setValue(SampManFormBase.ii_CommodityClassCode,
                new WrpInteger(currentCommodity.GetClassCode()));
    fB.setValue(SampManFormBase.ii_StandardUnitPrice,
                new WrpDecimal(currentCommodity.GetStandardUnitPrice()));
    return 1;
}
(MANDALA.J ではこの機能に対応したクラスを提供していません。
かわりに、java.lang.Integer クラスを使用してください。)