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

Arrays of structures

P: n/a
If I have a structure...

Public Structure UploadFile
Public FullPath As String
Public FileName As String
Public FileSize As String
Public FileType As String
Public DateModified As String
Public FileExtension As String
End Structure

And I wanted to store multiple "uploadFile" variables into an array, what
would be the proper syntax for that?

Ie: Dim UploadFileArray() as UploadFile

Don't you have to declare another variable as a 'new uploadfile' first?
Just confused over the proper syntax. Thanks for any help.
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"OpticTygre" <op********@adelphia.net> wrote in message
news:Zd********************@adelphia.com...
If I have a structure...

Public Structure UploadFile
Public FullPath As String
Public FileName As String
Public FileSize As String
Public FileType As String
Public DateModified As String
Public FileExtension As String
End Structure

And I wanted to store multiple "uploadFile" variables into an array, what
would be the proper syntax for that?

Ie: Dim UploadFileArray() as UploadFile

Don't you have to declare another variable as a 'new uploadfile' first?
Just confused over the proper syntax. Thanks for any help.

To use it you just: need to remember to Redim Preserve the array
To assign values
UploadFileArray(1).FullPath = "c:/your Path"
UploadFileArray(1).FileName = "yaddayadda.txt"
etc

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.769 / Virus Database: 516 - Release Date: 9/25/2004
Nov 21 '05 #2

P: n/a
The NEW method is not used when declaring Structures unless you have a NEW
sub as one of your structure elements.

"OpticTygre" wrote:
If I have a structure...

Public Structure UploadFile
Public FullPath As String
Public FileName As String
Public FileSize As String
Public FileType As String
Public DateModified As String
Public FileExtension As String
End Structure

And I wanted to store multiple "uploadFile" variables into an array, what
would be the proper syntax for that?

Ie: Dim UploadFileArray() as UploadFile

Don't you have to declare another variable as a 'new uploadfile' first?
Just confused over the proper syntax. Thanks for any help.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.