473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Arrays of structures

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
2 1449

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Java script Dude | last post by:
Some programmers prefer to stay with native level data structures such as string arrays instead of using Object based data structures such as ArrayList. From and efficiency point of view. Are...
7
by: Squignibbler | last post by:
Hi all, I have a question regarding the C++ programming language regarding the nature of the relationship between pointers and arrays. If the statement MyArray is functionally identical to...
33
by: Peter Seaman | last post by:
I understand that structures are value types and arrays and classes are reference types. But what about arrays as members of structures i.e. as in C struct x { int n; int a; }
1
by: ORC | last post by:
Hi, I have posted almost the same message in the compact framework group, but it seems to got lost in a deep message structure :-) so I'll try again: I'll receive a byte array from a serial...
2
by: Andrew Burlak | last post by:
Hi, Although Unsized Arrays inside structures is a non-standard feature, I like to use it :-) It seems that Unsized Arrays are broken when /Og (Global Optimization) is enabled. The problem...
1
by: Raj | last post by:
Hi, This is regarding using Arrays of UDT's in COM. The following is a short description: - We basically need a structure, struct MAIN_STRUCT which must contain a dynamic array of another...
1
by: John Dann | last post by:
Is it possible in VB.net to have arrays of structures (ie UDTs) where the structure definition includes one or more arrays? Something like: Structure MyUDT ItemOne () as byte 'for example sub...
10
by: David Fort | last post by:
Hi, I'm upgrading a VB6 app to VB.net and I'm having a problem with a call to a function provided in a DLL. The function takes the address of a structure which it will fill in with values. I...
0
by: Art Cummings | last post by:
Good morning all. I just finished an assignment using structures. In this assignment I used an array of structures. What I would have liked was to use an array of structures with a function. ...
127
by: sanjay.vasudevan | last post by:
Why are the following declarations invalid in C? int f(); int f(); It would be great if anyone could also explain the design decision for such a language restricton. Regards, Sanjay
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.