January 1, 2005

WinTask - AbsInt

'
' AbsInt - return the absolute value of a number
'
' Author: Joe Strazzere

'
' note: ABS is a WinTask keyword
'
Function AbsInt(int)
    If int < 0 Then
        AbsInt = -1 * int
    Else
        AbsInt= int
    EndIf
EndFunction

 

msgbox("The absolute value of "+Str$(-123)+" is "+Str$(AbsInt(-123)),0,"AbsInt")