Results 1 to 16 of 16

Thread: [RESOLVED] Maths.

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Resolved [RESOLVED] Maths.

    Hi Guys,

    In VB6, the following code gives me the error "Method or data member not found"


    Z = r1 * r2 * (pi / 2 + Math.asin(dFuelDepth / r2))

    the highlighted item is asin

    The error message appears immediately the sub containing the code is called. The sub is not even entered.

    Any ideas please
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Maths.

    Error is pretty self explanatory - asin function does not exist. There is a Sin instead.
    What are you calculating, anyway? Don't you get dropdown list of available members of Math class when you type Math and a dot?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: Maths.

    Hi,

    I am calibrating a dipstick for an elliptical cross section oil tank.

    The ASIN() function does NOT appear in the dropdown list after Math. but it is clearly documented in MSDN help.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  4. #4

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: Maths.

    Hi

    No, As I said in the first post, it is VB6. I am a little rusty in VB6 but am amending an old program.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Maths.

    Quote Originally Posted by taxes
    The ASIN() function does NOT appear in the dropdown list after Math. but it is clearly documented in MSDN help.
    As Martin correctly guessed ASin only exists in .Net but you posted in VB6 which is not the same as VB 2002-2008 (aka vb.net).
    VB6 does not have that function.

  7. #7
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Maths.

    in 2008 there is Math.Asin
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  8. #8

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: Maths.

    Quote Originally Posted by RhinoBull
    As Martin correctly guessed ASin only exists in .Net but you posted in VB6 which is not the same as VB 2002-2008 (aka vb.net).
    VB6 does not have that function.

    According to MSDN Library Visual Studio 6.0 the ASIN() function returns a numeric expression.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  10. #10

  11. #11

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: Maths.

    Hi guys,

    I have it now. I have to use Atn(x/Sqr(-x*x+1))


    !!!!

    Thanks everyone.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  12. #12

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: Maths.

    Quote Originally Posted by RhinoBull
    Right, but you could've at least admited that function you were refering to doesn't exist so other won't get confused.

    Regards.

    OK.... WARNING TO ALL. The ASIN() Function) clearly detailed in MSDN Library Visual Studio 6.0 is NOT recognised by VB6. The ARCSIN can be replicated using the procedure detailed in MSDN Derived Maths Functions.

    Happy?
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  14. #14
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Maths.

    Quote Originally Posted by taxes
    OK.... WARNING TO ALL. The ASIN() Function) clearly detailed in MSDN Library Visual Studio 6.0 is NOT recognised by VB6.
    That is because ASIN function is defined in C/C++/VC++, VFP and JScript (as far as MS concerns).
    So, when browsing MSDN you have to pay attention to language function belongs in.

  15. #15
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: Maths.

    Quote Originally Posted by RhinoBull
    So, when browsing MSDN you have to pay attention to language function belongs in.
    Rhino, that my be the understatement of the year. I have been trapped ny MSDN numerous times, thinking that what is there will work with VB6. It tends to make me long for reference books that are gone forever.
    Doctor Ed

  16. #16

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: Maths.

    Quote Originally Posted by RhinoBull
    That is because ASIN function is defined in C/C++/VC++, VFP and JScript (as far as MS concerns).
    So, when browsing MSDN you have to pay attention to language function belongs in.

    Agreed. But my point is that, if you look up the ASIN() description in MSDN, it nowhere states that the function is limited to a specific language. So, being naieve, I assumed that it was available in VB6. Yes, if you look up Arcsine it makes it clear, but I first looked up Asin.

    Anyway, my problem is solved and I have clarified it up as per your earlier post.

    AGAIN, THANKS GUYS.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width