VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



function to print the absolute value of a number

by Brandon (46 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 19th April 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

function to print the absolute value of a number

Rate function to print the absolute value of a number



Function AbsoluteVal(intVal As Integer) As Long
AbsoluteVal = intVal * 1
If AbsoluteVal < 0 Then: AbsoluteVal = intVal * -1
MsgBox "The absolute value of this number is " & AbsoluteVal
End Function

Private Sub Command1_Click()
'print absolute value of a number
Call AbsoluteVal(Text1)
End Sub

Download this snippet    Add to My Saved Code

function to print the absolute value of a number Comments

No comments have been posted about function to print the absolute value of a number. Why not be the first to post a comment about function to print the absolute value of a number.

Post your comment

Subject:
Message:
0/1000 characters