Abs Function

рдиреНрдпреВрдореЗрд░рд┐рдХ рдПрдХреНрд╕рдкреНрд░реЗрд╢рди рдХреЗ рдирд┐рд░рдкреЗрдХреНрд╖ рдорд╛рди рдХреЛ рдкреНрд░рд╕реНрддреБрдд рдХрд░рддрд╛ рд╣реИ.

Syntax:


Abs (Number)

рд╡рд╛рдкрд╕реА рдореВрд▓реНрдп:

Double

рдкреИрд░рд╛рдореАрдЯрд░

Number: Any numeric expression that you want to return the absolute value for. Positive numbers, including 0, are returned unchanged, whereas negative numbers are converted to positive numbers.

The following example uses the Abs function to calculate the difference between two values. It does not matter which value you enter first.

Error codes:

5 Invalid procedure call

рдЙрджрд╛рд╣рд░рдг:


Sub ExampleDifference
Dim siW1 As Single
Dim siW2 As Single
    siW1 = Int(InputBox("Please enter the first amount","Value Input"))
    siW2 = Int(InputBox("Please enter the second amount","Value Input"))
    Print "The difference is "; Abs(siW1 - siW2)
End Sub

Please support us!