VBFixedArrayAttribute クラス
アセンブリ: Microsoft.VisualBasic (microsoft.visualbasic.dll 内)

<AttributeUsageAttribute(AttributeTargets.Field, Inherited:=False, AllowMultiple:=False)> _ Public NotInheritable Class VBFixedArrayAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Field, Inherited=false, AllowMultiple=false)] public sealed class VBFixedArrayAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Field, Inherited=false, AllowMultiple=false)] public ref class VBFixedArrayAttribute sealed : public Attribute

詳細については、Visual Basic のトピック「VBFixedArrayAttribute クラス」を参照してください。
Visual Basic 配列は、既定で可変長になっています。この属性は、FileGet や FilePut など Visual Basic ファイルの入力関数および出力関数を使用する場合や、固定長の配列を必要とする API 呼び出しを使用する場合に便利です。

Structure Book <VBFixedArray(4)> Public Chapter() As Integer End Structure Sub WriteData() Dim FileNum As Integer = FreeFile() Dim MyBook As Book ReDim MyBook.Chapter(4) ' Add code to populate the array. MyBook.Chapter(0) = 1 MyBook.Chapter(1) = 2 MyBook.Chapter(2) = 3 MyBook.Chapter(3) = 4 MyBook.Chapter(4) = 5 ' Write the array to a file. FileOpen(FileNum, "C:\testfile", OpenMode.Binary, _ OpenAccess.Write, OpenShare.Default) FilePut(FileNum, MyBook) ' Write data. FileClose(FileNum) End Sub
![]() |
---|
VBFixedArrayAttribute は、情報提供を目的としており、ストレージの割り当ては行いません。この属性の目的は、VBFixedArrayAttribute を認識するメソッドまたは API 呼び出しによる構造体および非ローカル変数に含まれている配列の使用方法を変更することです。この属性が可変長の配列を固定長の配列に変換するものではないこと、また、Dim ステートメントまたは ReDim ステートメントを使用して配列ストレージを割り当てる必要があることに注意してください。 |

System.Attribute
Microsoft.VisualBasic.VBFixedArrayAttribute


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- VBFixedArrayAttribute クラスのページへのリンク