Click here to Skip to main content
15,032,755 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I declare a fixed length variable array? I'm stuck, any help will be appreciated:

Structure MyInformation
<VBFixedString(4),System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,SizeConst:=4)> Public ReturnStatus As String
<VBFixedString(6),System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,SizeConst:=6)> Public VariableA As String
                Public VariableB(3) As String * 6  Not sure how to declare
End Structure
Updated 24-May-12 23:45pm

Similar discussion: How can i declare string with size.[^]
to.areeb 25-May-12 5:22am
Not similar. here is different situation
Use the following Syntax to Declare Array

For Example :
Public Class Form1 
    Public Structure ExampleStructure 
        <vbfixedarray(10)> Public myArray() As String 
        <vbfixedstring(20)> Public myString As String 
    End Structure 
End Class

To Use this create new Instance :
Dim NewExample As New ExampleStructure

For more help try this:[^][^]
to.areeb 25-May-12 6:09am
Thanks Manoj for your reply you r right but my problem is I want array whoes string also fixed. like my array size is 5 and at same time i want my string lenth also fixed

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900