Simonc,
You need to define the type of your property as Byte() which is byte array.
Something like:
> Public Property ebcdicin() As Byte()
> Get
> edicin = m_ebcdicin
> End Get
> Set(ByVal value As Byte())
> m_edicin = value
> End Set
> End Property
Note you cannot give the actual size of the array on the property itself,
you can however check the size of the array in the property.
Also remember Arrays are references so you are actually sharing the array in
this implementation. Consider using Array.Clone to prevent sharing a single
instance of the array. (especially in the Set).
Hope this helps
Jay
"simonc" <(E-Mail Removed)> wrote in message
news:A8B6051A-ED3F-46B7-A9B7-(E-Mail Removed)...
> Can you define a property as type Byte array of a specific length?
>
> I am trying to pass a byte array which is 3200 bytes in length from one
> form
> (in which the bytes are read from a file) to another form (where the
> content
> can be edited). I have defined a property for the editing form using the
> following
>
> Dim m_edicin(3199) As Byte
> Public Property ebcdicin() As Byte
> Get
> edicin = m_ebcdicin
> End Get
> Set(ByVal Value As Byte)
> m_edicin = Value
> End Set
> End Property
>
> but it gives errors in the fourth and seventh lines of the type "Value of
> type '1-dimensional array of Byte' cannot be converted to 'Byte'" or vice
> versa.
>
> What is the secret to make this work?
>
> Grateful for any help.
|