»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 10-13-2003, 08:10 PM   #1 (permalink)
Registered User
 
Argon88's Avatar
 
Join Date: May 2002
Location: Virginia
Posts: 215
Argon88 is on a distinguished road
Microsoft Visual BASIC .net problem

I have an error in the program I'm making has an error in my calculate button code.

Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim dblUnitsPerYear As Double
Dim dblSetupCost As Double
Dim dblCarryingCost As Double
Dim dblProductionLotSize As Double

dblUnitsPerYear = Convert.ToDouble(nupUnitsPerYear.Value)
dblSetupCost = Convert.ToDouble(nupSetupCost.Value)
dblCarryingCost = Convert.ToDouble(nupCarryingCost.Value)

dblProductionLotSize =(2 * dblUnitsPerYear * dblSetupCost) / dblCarryingCost)^.5 'right here

txtProductionLotSize.Text = FormatNumber(dblProductionLotSize)
End Sub

Under the ^.5 there is squiglies, the massage it gives me is "end of statement expected." What's wrong?

Argon88 is offline   Reply With Quote
Old 10-13-2003, 08:17 PM   #2 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
dblProductionLotSize =(2 * dblUnitsPerYear * dblSetupCost) / dblCarryingCost)^.5

Kinda missing a right parens

I would guess it should be
dblProductionLotSize =(2 * dblUnitsPerYear * dblSetupCost) / dblCarryingCost)^.5)

__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 10-13-2003, 08:18 PM   #3 (permalink)
Registered User
 
Join Date: Dec 2002
Posts: 105
TheUnforgiven is on a distinguished road
NOpe its a left paren
this
dblProductionLotSize =(2 * dblUnitsPerYear * dblSetupCost) / dblCarryingCost)^.5
is
dblProductionLotSize =((2 * dblUnitsPerYear * dblSetupCost) / dblCarryingCost)^.5
TheUnforgiven is offline   Reply With Quote
Old 10-13-2003, 08:30 PM   #4 (permalink)
Registered User
 
Argon88's Avatar
 
Join Date: May 2002
Location: Virginia
Posts: 215
Argon88 is on a distinguished road
I thought it was something simple I was missing.

Thanks for the heads up.

By the way, is the error "end of statement expected" always coused by something like that?
Argon88 is offline   Reply With Quote
Old 10-13-2003, 08:47 PM   #5 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
ya, either a broken If/End If .. broken loop, or broken parens etc. Something of that nature 95% of the time.

(the other 5% lord only knows )
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 06:28 AM.