compile error


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: compile error

  1. #1
    Join Date
    Aug 2008
    Posts
    1

    Question compile error

    Private Sub Document_Open()
    'Declaring variables
    Dim dblInches As Double
    Dim intfeet As Double
    Dim resultMetres As Double
    Dim resultCentimetres As Long
    dblInches = intfeet
    intfeet = InputBox("Please enter the amount of feet", 5)

    'converting feet and inches to metres

    resultMetres = intfeet * 12 + dblInches * 2.54 / 100

    dblInches = InputBox("Please enter the amount of inches", 6)

    'converting centimetres to metres
    resultCentimetres = (resultMetres * 100)

    msgbox(resultmetres & resultmetres " & resultCentimetres & _
    "resultcentimetres" "the answer is")



    End Sub

  2. #2
    Join Date
    Oct 2005
    Location
    Staffordshire, England
    Posts
    101
    Welcome to DevX Dave.

    Quote Originally Posted by dave.h1
    Private Sub Document_Open()
    'Declaring variables
    Dim dblInches As Double
    Dim intfeet As Double
    Dim resultMetres As Double
    Dim resultCentimetres As Long
    dblInches = intfeet
    intfeet = InputBox("Please enter the amount of feet", 5)

    'converting feet and inches to metres

    resultMetres = intfeet * 12 + dblInches * 2.54 / 100

    dblInches = InputBox("Please enter the amount of inches", 6)

    End Sub
    I don't know why you are using dblInches = intfeet first of because intfeet comes from the first InputBox and dblInches comes from the second.

    Which line is giving the compile error?
    I've been programming with VB for 15 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

    Martin2k

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Is this in Word VBA?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Replies: 0
    Last Post: 11-24-2007, 07:34 AM
  2. Compile error from Boost Format lib
    By rssmps in forum C++
    Replies: 2
    Last Post: 04-05-2007, 01:21 PM
  3. Replies: 5
    Last Post: 01-17-2007, 02:37 PM
  4. Link error
    By Shar in forum C++
    Replies: 5
    Last Post: 12-19-2006, 07:07 AM
  5. Replies: 1
    Last Post: 01-08-2003, 03:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center