...

View Full Version : VB Arrays through function that is larger than input



joey,choey
12-20-2010, 12:58 AM
Hello,
I have an function that has an array, when a user inputs a number it catches the array through the function and gets the pricing back.

Although when the user inputs something larger than 4 I would like it to display the same contents as the 4th column...It's auto populated to:


0 1 2 3 4
1 # # # # #
2 # # # # #
3 # # # # #
4 24 32 34 37 42

Lets say a user inputs 0 for the row and 6 for the column.
Is there a way to display the same contents as 4?


Sorry if i don't explain this right. New to programming...

Thank you.

pigpen
12-23-2010, 07:45 PM
Dim userInputCol As Integer = 6
Dim userInputRow As Integer = 0

If (userInputCol >= 6) AndAlso (userInputRow = 0) Then
Console.WriteLine("col and row is 6 and 0, so show column 4 contents")
Else
Console.WriteLine("show the column and row")
End If

That should give you the logic to do it. Replace the Console.WriteLine lines with your array finding code.

edit: fixed a typo. I had "4" instead of "6" originally.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum