Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

does anyone know how to do the following in vb.net:

 

Private Type ID3Tag

Tag As String * 3

Title As String * 30

Artist As String * 30

Album As String * 30

Year As String * 4

Comment As String * 28

End Type

 

i know that you make is a structure:

 

Private Structure ID3Tag

Public Tag As String

Public Title As String

Public Artist As String

Public Album As String

Public Year As String

Public Comment As String

End Structure

 

but how do you specify the lenth of the properties? thanks...

Posted

quoted from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vaconstringlength.asp

 

In Visual Basic .NET, you cannot declare a string to have a fixed length unless you use the VBFixedStringAttribute Class attribute in the declaration.

You declare a string without a length. When your code assigns a value to the string, the length of the value determines the length of the string, as in the following example:

 

Dim Name As String 
' ... 
Name = "Name is now 30 characters long" ' Length can be changed later. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...