Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-19-2010, 11:58 PM   PM User | #1
joey,choey
New Coder

 
Join Date: Jul 2008
Posts: 48
Thanks: 1
Thanked 0 Times in 0 Posts
joey,choey is an unknown quantity at this point
VB Arrays through function that is larger than input

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:

Code:
    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.
joey,choey is offline   Reply With Quote
Old 12-23-2010, 06:45 PM   PM User | #2
pigpen
Regular Coder

 
Join Date: Dec 2007
Posts: 137
Thanks: 1
Thanked 21 Times in 21 Posts
pigpen is on a distinguished road
Code:
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.
pigpen is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:45 AM.


Advertisement
Log in to turn off these ads.