Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 109,491 VB Programmers for FREE! Ask your question and get quick answers from experts. There are 1,193 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Need help on Array

 
Reply to this topicStart new topic

Need help on Array, put different filename name in array

kill99
post 5 Aug, 2008 - 12:55 AM
Post #1


New D.I.C Head

*
Joined: 3 May, 2008
Posts: 23


My Contributions


Let say i got a array of 10 field each time i have different type of filename how would i know it will like go to first to last of the array
User is offlineProfile CardPM

Go to the top of the page


Zhalix
post 5 Aug, 2008 - 06:28 AM
Post #2


D.I.C Head

**
Joined: 7 May, 2008
Posts: 217



Thanked 9 times
My Contributions


I'm confused, but I think you want to know how to cycle through the first to last index of the array. You can use a For-Loop to do this.

CODE
For i = 0 to UBound(Array)
    Array(i) = "Lala"
Next i
User is offlineProfile CardPM

Go to the top of the page

kill99
post 5 Aug, 2008 - 08:16 AM
Post #3


New D.I.C Head

*
Joined: 3 May, 2008
Posts: 23


My Contributions


ok i explain what i need to do i helping out my company doing a program where it can import a batch file will contain serial number to convert it to excel after converting i need to sort it out to the columns and able to carry on doing the same step again

The problem is when is the part of the array how would i know the serial number will be in ascending order and will be input to the array

Example:array(10) field

array(1) serial number 5062
array(2) serial number 5063
array(3) serial number 5066
User is offlineProfile CardPM

Go to the top of the page

MrWobbles
post 5 Aug, 2008 - 09:49 AM
Post #4


D.I.C Head

**
Joined: 11 Apr, 2008
Posts: 54


My Contributions


You just need to sort your array, there are functions in VB for doing this such as Array.Sort(), but there are other ways to do it as well, try a Google search or here is the Microsoft website explaining their sort() function:

http://msdn.microsoft.com/en-us/library/zfce6bw8(VS.80).aspx

This post has been edited by MrWobbles: 5 Aug, 2008 - 09:50 AM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 9/7/08 02:09PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month