identifier expected VB

August 5, 2010 at 05:53:12
Specs: Windows XP

I have problem in VB
Im trying to create a program that will convert English to Metric System but it comes with error and can not display the result in RichTextBox.
Dim miles As Double
Dim yards As Double
Dim feet As Double
Dim inches As Double
Dim meters As Double
Dim kilometers As Double
Dim centimeters As Double
Dim totalInches As Double

miles = CInt(txtMiles.Text)
yards = CInt(txtYards.Text)
feet = CInt(txtFeet.Text)
inches = CInt(txtInches.Text)


totalInches = 63360 * miles + 36 * yards + 12 * feet + inches
meters = (totalInches / 39.37)
kilometers = Int(meters / 1000)
centimeters = (meters / 100)

kilometers = (totalInches / 39.37) / 1000
meters = (kilometers - Math.Floor(kilometers)) * 1000
centimeters = (meters - Math.Floor(meters)) * 100

With DialogResult.
.Clear()
.Add("The metric length is:")
.Add(Math.Floor(kilometers) & " kilometers")
.Add(Math.Floor(meters) & " meters")
.Add(Math.Round(centimeters, 2) & " centimeters")
End With

With lstDialogueResultsItems.
.Clear()
.Add("The metric length is:")
.Add(kilometers & " kilometers")
.Add(meters & " meters")
.Add(centimeters & " centimeters")
End With

End Sub


See More: identifier expected VB

Report •


#1
August 5, 2010 at 11:24:52

but it comes with error and can not display the result in RichTextBox.
And? What's the error? Where's the error?

Is it in the With lines? Because you should remove the trailing period off those lines.


Report •
Related Solutions


Ask Question