Information.VarType メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Information.VarType メソッドの意味・解説 

Information.VarType メソッド

変数データ型分類を含む Integer 値を返します

名前空間: Microsoft.VisualBasic
アセンブリ: Microsoft.VisualBasic (microsoft.visualbasic.dll 内)
構文構文

Public Shared Function VarType
 ( _
    VarName As Object _
) As VariantType
Dim VarName As Object
Dim returnValue As VariantType

returnValue = Information.VarType(VarName)
public static VariantType VarType (
    Object VarName
)
public:
static VariantType VarType (
    Object^ VarName
)
public static VariantType VarType (
    Object VarName
)
public static function VarType
 (
    VarName : Object
) : VariantType

パラメータ

VarName

必須Object 変数です。Option StrictOff場合構造体以外の任意のデータ型変数を渡すことができます

戻り値
変数データ型分類を含む Integer 値を返します

解説解説

詳細については、Visual Basicトピック「VarType 関数 (Visual Basic)」を参照してください

VarType により返される整数値は、VariantType 列挙型メンバです。

次の表に、特殊な VarName に対して VarType により返される値を示します

VarName により表されるデータ型

VarType により返される

Nothing (Visual Basic)

VariantType.Object

DBNull

VariantType.Null

列挙

基になるデータ型 (SByteByteShortUShortIntegerUIntegerLongULong)

配列

配列要素の型と VariantType.Arrayビットごとの OR

配列配列

VariantType.ObjectVariantType.Arrayビットごとの OR

構造体 (System.ValueType)

VariantType.UserDefinedType

Exception

VariantType.Error

Unknown

VariantType.Object

使用例使用例

VarType 関数使用して複数変数に関するデータ型分類情報返す例を次に示します

Dim testString As String
 = "String for testing"
Dim testObject As New Object
Dim testNumber, testArray(5) As Integer
Dim testVarType As VariantType
testVarType = VarType(testVarType)
' Returns VariantType.Integer.
testVarType = VarType(testString)
' Returns VariantType.String.
testVarType = VarType(testObject)
' Returns VariantType.Object.
testVarType = VarType(testNumber)
' Returns VariantType.Integer.
testVarType = VarType(testArray)
' Returns the bitwise OR of VariantType.Array and VariantType.Integer.
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からInformation.VarType メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からInformation.VarType メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からInformation.VarType メソッドを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Information.VarType メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Information.VarType メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS