VBFixedStringAttributeとは? わかりやすく解説

VBFixedStringAttribute クラス

文字列を固定長として扱う必要があることを示します。

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

<AttributeUsageAttribute(AttributeTargets.Field, Inherited:=False, AllowMultiple:=False)>
 _
Public NotInheritable Class
 VBFixedStringAttribute
    Inherits Attribute
Dim instance As VBFixedStringAttribute
[AttributeUsageAttribute(AttributeTargets.Field, Inherited=false,
 AllowMultiple=false)] 
public sealed class VBFixedStringAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Field, Inherited=false,
 AllowMultiple=false)] 
public ref class VBFixedStringAttribute sealed
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Field, Inherited=false,
 AllowMultiple=false) */ 
public final class VBFixedStringAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Field, Inherited=false,
 AllowMultiple=false) 
public final class VBFixedStringAttribute extends
 Attribute
解説解説

詳細については、Visual Basic のトピック「VBFixedStringAttribute クラス」を参照してください。

Visual Basic 文字列は、既定で可変長になっています。この属性は、FileGet や FilePut など、固定長の配列を必要とする Visual Basic ファイルの入力関数および出力関数を使用する場合に便利です。

使用例使用例
Structure Person
    Public ID As Integer
    Public MonthlySalary As Decimal
    Public LastReviewDate As Long
    <VBFixedString(15)> Public FirstName As
 String
    <VBFixedString(15)> Public LastName As
 String
    <VBFixedString(15)> Public Title As
 String
    <VBFixedString(150)> Public ReviewComments As
 String
End Structure
メモメモ

VBFixedStringAttribute は情報を提供するものであり、可変長文字列から固定長文字列への変換には使用できません。この属性の目的は、VBFixedStringAttribute を認識するメソッドまたは API 呼び出しにおける、構造体および非ローカル変数に含まれている配列の使用方法を変更することです。この属性は文字列の実際の長さを変更するものではありません。

継承階層継承階層
System.Object
   System.Attribute
    Microsoft.VisualBasic.VBFixedStringAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VBFixedStringAttribute メンバ
Microsoft.VisualBasic 名前空間
StringBuilder
MarshalAsAttribute
その他の技術情報
VBFixedStringAttribute クラス
Visual Basic における属性
VBFixedStringAttribute クラス メンバ
VBFixedArrayAttribute クラス
ComClassAttribute クラス
Visual Basic で使用される属性
FileGet 関数
FilePut 関数
FileOpen 関数

VBFixedStringAttribute コンストラクタ

SizeConst フィールドの値を初期化します。

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

Dim Length As Integer

Dim instance As New VBFixedStringAttribute(Length)
public VBFixedStringAttribute (
    int Length
)
public:
VBFixedStringAttribute (
    int Length
)
public VBFixedStringAttribute (
    int Length
)
public function VBFixedStringAttribute (
    Length : int
)

パラメータ

Length

固定長文字列の長さ。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

VBFixedStringAttribute プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ .NET Compact Framework によるサポート TypeId  派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。)
参照参照

関連項目

VBFixedStringAttribute クラス
Microsoft.VisualBasic 名前空間
StringBuilder
MarshalAsAttribute

その他の技術情報

VBFixedStringAttribute クラス
Visual Basic における属性
VBFixedStringAttribute クラス メンバ
VBFixedArrayAttribute クラス
ComClassAttribute クラス
Visual Basic で使用される属性
FileGet 関数
FilePut 関数
FileOpen 関数

VBFixedStringAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

VBFixedStringAttribute クラス
Microsoft.VisualBasic 名前空間
StringBuilder
MarshalAsAttribute

その他の技術情報

VBFixedStringAttribute クラス
Visual Basic における属性
VBFixedStringAttribute クラス メンバ
VBFixedArrayAttribute クラス
ComClassAttribute クラス
Visual Basic で使用される属性
FileGet 関数
FilePut 関数
FileOpen 関数

VBFixedStringAttribute メンバ

文字列を固定長として扱う必要があることを示します。

VBFixedStringAttribute データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド VBFixedStringAttribute SizeConst フィールドの値を初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ .NET Compact Framework によるサポート TypeId  派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

VBFixedStringAttribute クラス
Microsoft.VisualBasic 名前空間
StringBuilder
MarshalAsAttribute

その他の技術情報

VBFixedStringAttribute クラス
Visual Basic における属性
VBFixedStringAttribute クラス メンバ
VBFixedArrayAttribute クラス
ComClassAttribute クラス
Visual Basic で使用される属性
FileGet 関数
FilePut 関数
FileOpen 関数



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「VBFixedStringAttribute」の関連用語

VBFixedStringAttributeのお隣キーワード
検索ランキング

   

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



VBFixedStringAttributeのページの著作権

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

©2026 GRAS Group, Inc.RSS