Arrays of structures

O

OpticTygre

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.
 
H

Hal Rosser

OpticTygre said:
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
 
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top