Click here to Skip to main content
15,895,256 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: save array Pin
Ashfield25-Mar-09 22:47
Ashfield25-Mar-09 22:47 
GeneralRe: save array Pin
moonshaddow26-Mar-09 12:48
moonshaddow26-Mar-09 12:48 
QuestionI have a final working project in Visual basic 2008. Pin
katie2325-Mar-09 12:34
katie2325-Mar-09 12:34 
AnswerRe: I have a final working project in Visual basic 2008. Pin
Henry Minute25-Mar-09 13:13
Henry Minute25-Mar-09 13:13 
AnswerRe: I have a final working project in Visual basic 2008. Pin
tech60325-Mar-09 20:00
tech60325-Mar-09 20:00 
GeneralRe: I have a final working project in Visual basic 2008. Pin
katie2325-Mar-09 21:33
katie2325-Mar-09 21:33 
QuestionEasy Q:How to find the longest name(user input) in an array? Pin
Haroon Ghazni25-Mar-09 11:31
Haroon Ghazni25-Mar-09 11:31 
AnswerRe: Easy Q:How to find the longest name(user input) in an array? Pin
Henry Minute25-Mar-09 11:55
Henry Minute25-Mar-09 11:55 
There are two things I would like to point out:

The first, is that nowhere in your code, do you examine all of the elements of Members(0). You only examine one element.
In order to resolve this problem you need to learn how to iterate through the elements of the array. To find out how to do that, why not search MSDN or google for the words in bold.

The second thing is fairly small:
Your code:
LongName = Members(0).Name
LengthOfLongestName = Len(Members(0).Name)


The first line gets the name from the array element. Accessing stuff in arrays is reasonably costly in terms of the processing required. So, in the second line, don't get the length by diving into the array again, use the name you have already fetched.

Modified code:
LongName = Members(0).Name
LengthOfLongestName = Len(LongName)


Good luck!

Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: Easy Q:How to find the longest name(user input) in an array? [modified] Pin
Haroon Ghazni25-Mar-09 12:32
Haroon Ghazni25-Mar-09 12:32 
GeneralRe: Easy Q:How to find the longest name(user input) in an array? Pin
Henry Minute25-Mar-09 13:11
Henry Minute25-Mar-09 13:11 
GeneralRe: Easy Q:How to find the longest name(user input) in an array? Pin
Luc Pattyn25-Mar-09 14:03
sitebuilderLuc Pattyn25-Mar-09 14:03 
GeneralRe: Easy Q:How to find the longest name(user input) in an array? Pin
Henry Minute25-Mar-09 14:14
Henry Minute25-Mar-09 14:14 
GeneralRe: Easy Q:How to find the longest name(user input) in an array? Pin
JernejR26-Mar-09 1:43
JernejR26-Mar-09 1:43 
GeneralRe: Easy Q:How to find the longest name(user input) in an array? Pin
Henry Minute26-Mar-09 1:54
Henry Minute26-Mar-09 1:54 
QuestionHow many charcters per line When Printing Pin
Ryan Fleming25-Mar-09 9:27
Ryan Fleming25-Mar-09 9:27 
AnswerRe: How many charcters per line When Printing Pin
dan!sh 25-Mar-09 9:37
professional dan!sh 25-Mar-09 9:37 
GeneralRe: How many charcters per line When Printing Pin
Ryan Fleming26-Mar-09 4:51
Ryan Fleming26-Mar-09 4:51 
AnswerRe: How many charcters per line When Printing Pin
Dave Kreskowiak25-Mar-09 10:40
mveDave Kreskowiak25-Mar-09 10:40 
GeneralRe: How many charcters per line When Printing Pin
Tom Deketelaere25-Mar-09 23:43
professionalTom Deketelaere25-Mar-09 23:43 
GeneralRe: How many charcters per line When Printing Pin
Dave Kreskowiak26-Mar-09 4:23
mveDave Kreskowiak26-Mar-09 4:23 
GeneralRe: How many charcters per line When Printing Pin
Tom Deketelaere26-Mar-09 4:29
professionalTom Deketelaere26-Mar-09 4:29 
JokeRe: How many charcters per line When Printing Pin
Ryan Fleming26-Mar-09 4:52
Ryan Fleming26-Mar-09 4:52 
QuestionLTrim Pin
vijay248225-Mar-09 5:35
vijay248225-Mar-09 5:35 
AnswerRe: LTrim Pin
Yusuf25-Mar-09 5:43
Yusuf25-Mar-09 5:43 
GeneralRe: LTrim Pin
vijay248225-Mar-09 5:53
vijay248225-Mar-09 5:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.