By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,812 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

pb resizing FixedArray

P: n/a
Hi,

I have the following structure:
Structure CCat
Public code As Short
<VBFixedString(17)> Public nom As String
<VBFixedArray(30)> Public scat() As String ' scat is a N dimention
table of exactly 30 caracters

Public Sub Initialize(ByVal sizeSCat As Integer)
ReDim scat(sizeSCat)
End Sub
End Structure

in my code, he is what I'm trying to do:
Dim categ As CCat
Dim x As Integer = Len(categ)
categ.Initialize(5) ' the dimention
of the table is 5
x = Len(categ)

x has the same value before and after the resize. And naturally, when I use
a FileGet function to retreive my data, I have a record length error.

Can someone tell me what I did wrong ?

Thanks a lot
David
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi David,

Len (categ) will give you the size of a CCat, ie. its contents.
Unfortunately scat, which is part of the contents, is not wholly within a
CCat, as it were. The actual array of strings is <associated> with the
structure but not part of it. The size of CCat is the size of nom, a fixed
length string, and scat, a reference variable. As such, it is constant.

Regards,
Fergus
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.