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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
the_billConnect With a Mentor Commented:
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
 
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
All Courses

From novice to tech pro — start learning today.