The 2014 Corvette Stingray Forum
News / Blog Register Community Calendar Today's Posts Search

Go Back   Chevrolet Corvette Stingray C7 Forum > Members Area > Off-topic Discussions

Reply
 
Thread Tools
Old 07-30-2010, 06:31 PM   #1
pnyklr

 
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
pnyklr is offline   Reply With Quote
Old 07-30-2010, 06:34 PM   #2
brandotron
I am the internets.
 
brandotron's Avatar
 
Drives: dangerously
Join Date: May 2009
Location: Redondo Beach, CA
Posts: 12,571
I have a little experience, but I'm more designer than developer. Maybe ask GTAHVIT or helmincamaro, they're techie like that.
__________________
brandotron is offline   Reply With Quote
Old 07-30-2010, 06:38 PM   #3
NoUCantDriveIt


 
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?
__________________
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
NoUCantDriveIt is offline   Reply With Quote
Old 07-30-2010, 06:41 PM   #4
pnyklr

 
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
pnyklr is offline   Reply With Quote
Old 07-30-2010, 06:45 PM   #5
brandotron
I am the internets.
 
brandotron's Avatar
 
Drives: dangerously
Join Date: May 2009
Location: Redondo Beach, CA
Posts: 12,571
Quote:
Originally Posted by NoUCantDriveIt View Post
I know vb.net... what's your Q?
Hey Deb!
__________________
brandotron is offline   Reply With Quote
Old 07-30-2010, 06:50 PM   #6
NoUCantDriveIt


 
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?
__________________
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
NoUCantDriveIt is offline   Reply With Quote
Old 07-30-2010, 06:51 PM   #7
NoUCantDriveIt


 
Drives: 2SS RS M6 CGM/Black Rally
Join Date: Sep 2009
Location: Austin TX
Posts: 5,098
Hi brando-mano!
__________________
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
NoUCantDriveIt is offline   Reply With Quote
Old 07-30-2010, 06:52 PM   #8
brandotron
I am the internets.
 
brandotron's Avatar
 
Drives: dangerously
Join Date: May 2009
Location: Redondo Beach, CA
Posts: 12,571
Quote:
Originally Posted by NoUCantDriveIt View Post
Hi brando-mano!
Never did see pics of your car...
__________________
brandotron is offline   Reply With Quote
Old 07-30-2010, 06:55 PM   #9
pnyklr

 
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
pnyklr is offline   Reply With Quote
Old 07-30-2010, 08:09 PM   #10
NoUCantDriveIt


 
Drives: 2SS RS M6 CGM/Black Rally
Join Date: Sep 2009
Location: Austin TX
Posts: 5,098
Quote:
Originally Posted by pnyklr View Post
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
Sorry for the delay OP... arrays are zero based...
change myarray.Length - 2
to myarray.Length - 1

I think you're shorting yourself a loop
__________________
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
NoUCantDriveIt is offline   Reply With Quote
Old 07-30-2010, 08:33 PM   #11
pnyklr

 
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
pnyklr is offline   Reply With Quote
Reply


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

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


All times are GMT -5. The time now is 03:19 AM.


Powered by vBulletin® Version 3.8.9 Beta 4
Copyright ©2000 - 2026, vBulletin Solutions, Inc.