|
|
#1 |
![]() ![]() ![]() ![]() ![]() Drives: A Gift From My Wife Join Date: Apr 2009
Location: Powder Springs, GA
Posts: 1,557
|
Anyone here familiar with VB.NET
Have some questions about what should be a very simple answer but I am having trouble answering it.
-Funk |
|
|
|
|
|
#2 |
|
I am the internets.
|
I have a little experience, but I'm more designer than developer. Maybe ask GTAHVIT or helmincamaro, they're techie like that.
__________________
|
|
|
|
|
|
#3 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Drives: 2SS RS M6 CGM/Black Rally Join Date: Sep 2009
Location: Austin TX
Posts: 5,098
|
I know vb.net... what's your Q?
__________________
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
|
|
|
|
|
|
#4 |
![]() ![]() ![]() ![]() ![]() Drives: A Gift From My Wife Join Date: Apr 2009
Location: Powder Springs, GA
Posts: 1,557
|
Trying to accomplish this equation 100-150= negative 50. Instead I am getting a positive 50.
My head hurts. Count = 2 First time through result = 0, myarray(0) = 100. So 100 minus 0 =100. Result =100 Second time through result =100, myarray(1) = 150. So 150 minus 100 = 50. -------------------------------------------------------------- For count As Integer = 0 To myarray.Length - 2 result = myarray(count) - result Next |
|
|
|
|
|
#5 |
|
I am the internets.
|
__________________
|
|
|
|
|
|
#6 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Drives: 2SS RS M6 CGM/Black Rally Join Date: Sep 2009
Location: Austin TX
Posts: 5,098
|
what type do you have result dim'd as?
__________________
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
|
|
|
|
|
|
#7 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Drives: 2SS RS M6 CGM/Black Rally Join Date: Sep 2009
Location: Austin TX
Posts: 5,098
|
Hi brando-mano!
__________________
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
|
|
|
|
|
|
#8 |
|
I am the internets.
|
__________________
|
|
|
|
|
|
#9 |
![]() ![]() ![]() ![]() ![]() Drives: A Gift From My Wife Join Date: Apr 2009
Location: Powder Springs, GA
Posts: 1,557
|
Dim result As Integer
Here is the code: count = InputBox("Enter the amount of numbers you want to add", , "Enter") ReDim myarray(count) For count As Integer = 0 To myarray.Length - 2 myarray(count) = InputBox("Please enter a value for position " & count, "myArray") Next Response.Write(myarray.Length & "<br />") Response.Write(myarray(0) & "<br />") Response.Write(myarray(1) & "<br />") Response.Write(myarray(2) & "<br />") For count As Integer = 0 To myarray.Length - 2 result = result + myarray(count) Next Response.Write("The sum of the values is " & result) End Sub |
|
|
|
|
|
#10 | |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Drives: 2SS RS M6 CGM/Black Rally Join Date: Sep 2009
Location: Austin TX
Posts: 5,098
|
Quote:
change myarray.Length - 2 to myarray.Length - 1 I think you're shorting yourself a loop
__________________
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
|
|
|
|
|
|
|
#11 |
![]() ![]() ![]() ![]() ![]() Drives: A Gift From My Wife Join Date: Apr 2009
Location: Powder Springs, GA
Posts: 1,557
|
If I change the -2 to a -1 it asks me to input 3 numbers even though count is set to 2. Granted logically it should be -1 but it no worky when set to -1.
Are you talking about nesting another loop inside the For/Next? Thanks! -Funk |
|
|
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Anyone familiar with industrial gearboxes? | cstproductions | Off-topic Discussions | 6 | 05-03-2010 09:22 AM |
| Anyone here familiar or used SIMONIZE GLASS COATING for PAINT? | 55Designs | 5th Gen Camaro SS LS LT General Discussions | 4 | 04-27-2010 12:31 AM |
| Familiar with GMLAN and interested in CarPC? | Toasty | Audio, Video, Bluetooth, Navigation, Radar, Electronics Forum | 14 | 04-25-2010 10:49 PM |
| Anyone familiar with CHERRY BOMB mufflers? | Revo1 | Camaro V6 LLT Engine, Exhaust, and Bolt-Ons | 7 | 03-23-2010 03:20 PM |
| Hmmm this girl looks familiar on a ford website | elcamino | Off-topic Discussions | 19 | 03-21-2010 10:51 PM |