IBM Lotus Symphony
|
يتم ارجاع القيمة المطلقة لتعبير رقمي.
Abs (Number)
Double
Number: أي تعبير رقمي تريد ارجاع القيمة المطلقة له. يتم ارجاع القيم الموجبة، متضمنة 0، بدون تغيير، لكن الأرقام السالبة يتم تحويلها الى أرقام موجبة.
يقوم المثال التالي باستخدام وظيفة Abs function لحساب الفرق بين قيمتين. لا يهم أي القيمتين قمت بادخالها أولا.
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