Solved

New question about VB.NET

Posted on 2003-11-24
1
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 52
Visual Studio search word table and return Cell index 8 78
Modifying Conditional Format from VBA code 3 71
Advice in Xamarin 21 109
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

733 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