What's the fix for this VB error message?

Overload resolution failed because no Public 'Abs' can be called without a narrowing conversion:
    'Public Shared Function Abs(value As Single) As Single':
        Argument matching parameter 'value' narrows from 'Boolean' to 'Single'.
    'Public Shared Function Abs(value As Double) As Double':
        Argument matching parameter 'value' narrows from 'Boolean' to 'Double'.
    'Public Shared Function Abs(value As Decimal) As Decimal':
        Argument matching parameter 'value' narrows from 'Boolean' to 'Decimal'.
    'Public Shared Function Abs(value As Long) As Long':
        Argument matching parameter 'value' narrows from 'Boolean' to 'Long'.
    'Public Shared Function Abs(value As SByte) As SByte':
        Argument matching parameter 'value' narrows from 'Boolean' to 'SByte'.
    'Public Shared Function Abs(value As Short) As Short':
        Argument matching parameter 'value' narrows from 'Boolean' to 'Short'.
    'Public Shared Function Abs(value As Integer) As Integer':
        Argument matching parameter 'value' narrows from 'Boolean' to 'Integer'.
bergen69Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the_billCommented:
Hi,

it looks like you're sending a boolean variable as the parameter, which will be accepted by all the implementations

Check your input value, and cast it first if necessary
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
exx1976Commented:
On Error Resume Next usually gets rid of my errors.   :D
0
vb_studentCommented:
using on error resume next just tells the script to ignore the error. i think the_bill is right. could you give us some of the source code? i would not suggest on error resume next unless it is in commertial use.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

exx1976Commented:
It was a joke, student.

On Error Resume Next isn't even valid in VB, only VBS.

And it's spelled commercial.   :D
0
vb_studentCommented:
isn't this VBS? and I don't claim good spelling. at least you understood me
0
exx1976Commented:
It's in the VBS zone, but it doesn't belong here.  The code is VB.  VBS doesn't allow "public shared", nor does it care about boolean or Long or Short or Sbyte, as VBS uses untyped variables.
0
vb_studentCommented:
I see your problem. it is not that it needs to be boolean it is that it can't be boolean. what are you trying to do with this code?
0
j-horbCommented:
I believe that, in VB6, ABS(<boolean>) would return 0 or 1. In VB.NET, ABS(<boolean>) is invalid. Not sure what you are trying to do, though.
0
RobSampsonCommented:
Hi, isn't ABS a reserved function already?  I don't think you can override that function.  If ABS is already a reserved function, and you are trying to create a user defined function, then use something like

Public Shared Function MyAbs(value As Single) As Single

so that you create a unique function name.

Regards,

Rob.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.