Solved

New question about VB.NET

Posted on 2003-11-24
1
148 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Controlling which port to download from 4 71
Visual Studio search word table and return Cell index 8 48
VB 6 error 5 in windows 10 but not in XP 7 39
vbModal 12 31
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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

930 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now