VBFixedStringAttribute Class
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)
'Declaration <AttributeUsageAttribute(AttributeTargets.Field, Inherited:=False, AllowMultiple:=False)> _ Public NotInheritable Class VBFixedStringAttribute Inherits Attribute 'Usage Dim instance As VBFixedStringAttribute
/** @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
For more detailed information, see the Visual Basic topic VBFixedStringAttribute Class.
Visual Basic strings are of variable length by default. This attribute is useful when using Visual Basic file input and output functions such as FileGet and FilePut that require fixed length strings.
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
Note |
|---|
| The VBFixedStringAttribute is informational and cannot be used to convert a variable length string to a fixed string. The purpose of this attribute is to modify how strings in structures and non-local variables are used by methods or API calls that recognize the VBFixedStringAttribute. Keep in mind that this attribute does not change the actual length of the string itself. |
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
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Reference
VBFixedStringAttribute MembersMicrosoft.VisualBasic Namespace
StringBuilder
MarshalAsAttribute
Other Resources
VBFixedStringAttribute ClassAttributes in Visual Basic
VBFixedStringAttribute Class Members
VBFixedArrayAttribute Class
ComClassAttribute Class
Attributes Used in Visual Basic
FileGet Function
FilePut Function
FileOpen Function
Note