Solved

New question about VB.NET

Posted on 2003-11-24
1
149 Views
Last Modified: 2010-05-03
How can I sorting and searching information from a textfile use array?

For instance,    sort names by A.B.C.D...Z
 
                       search person's information by their firstname,lastname and major code  etc.

I don't know to use array,it seems a little complex for me, and I don't understand what textbook showed me.


Waiting for help

regards,  


Ge

 
0
Comment
Question by:gegou
1 Comment
 
LVL 42

Accepted Solution

by:
frodoman earned 125 total points
ID: 9814115
The easiest way to think of an array as a list.  A list has 1 or more items that you can look at individually.

Item#1 = Apple
Item#2 = Orange
Item#3 = Grape

Any time you want you can check to see what Item#3 is ("grape").  You don't have to read the entire list, you can just count down 3 items and see what it says.

So in an array this could be:

Food(1) = "Apple"
Food(2) = "Orange"
Food(3) = "Grape"


So if you want to check what the 3rd item in the array/list is, you'd just do something like: writeline Food(3)

Then later if you say IF Food(2) < Food(3) THEN Something what you're asking is if the 2nd item in the list is less than the 3rd item in the list.  If the items are numbers, it's as simple as that.  If the items are text (like this example) then "less than" means alphabetically less (e.g.: A is less than B, B is less than C, etc.)

I'm not going to do your homework for you, but hopefully this answer helps you understand what an array is so you can grasp from here.

Good luck!
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question