I have created the following wizard
<----------------------- CUT HERE
{ GLOBAL =
Function amRoundUp(ByVal dNum as Double) as Double
Dim lErr as Long
Dim holeNo as String, Digit as String, Remain as String, twoDigit as String
Dim dNumber as Double
holeNo = LeftPart(CStr(dNum),".",0)
Remain = RightPartFromLeft(CStr(dNum),".",0)
Digit = Mid(Remain,3,1)
twoDigit = Mid(Remain,1,2)
If Digit > 4 Then
dNumber = CDbl(holeNo &"."& twoDigit) + 0.01
Else
dNumber = CDbl(holeNo &"."& twoDigit)
End If
amRoundUp(dNumber)
End Function
}
NAME = "Wizard"
VERSION = "2354"
{ PAGE PAGE1
{ NUMBOX NUMBOX1
FORMAT = "double"
MINVALUE = "0"
VALUE = "0"
}
{ COMMANDBUTTON COMMANDBUTTON1
CAPTION = "Round"
{ CLICK =
Dim lErr as Long
lErr = AmSetProperty("numbox2",amRoundUp({numbox1}))
}
{ ENABLED =
If {numbox1} <> 0.00 Then
RetVal = 1
Else
RetVal = 0
End If
}
}
{ NUMBOX NUMBOX2
FORMAT = "Double"
VALUE = "0"
}
}
{ FINISH FINISH
}
<----------------------- END CUT
Everytime I run this simple wizard, Dr Watson pops up. Anyone got any ideas how to fix this or implement a function that rounds double values to 2 decimal places? Jason Thomas
AssetCenter Consultant
<----------------------- CUT HERE
{ GLOBAL =
Function amRoundUp(ByVal dNum as Double) as Double
Dim lErr as Long
Dim holeNo as String, Digit as String, Remain as String, twoDigit as String
Dim dNumber as Double
holeNo = LeftPart(CStr(dNum),".",0)
Remain = RightPartFromLeft(CStr(dNum),".",0)
Digit = Mid(Remain,3,1)
twoDigit = Mid(Remain,1,2)
If Digit > 4 Then
dNumber = CDbl(holeNo &"."& twoDigit) + 0.01
Else
dNumber = CDbl(holeNo &"."& twoDigit)
End If
amRoundUp(dNumber)
End Function
}
NAME = "Wizard"
VERSION = "2354"
{ PAGE PAGE1
{ NUMBOX NUMBOX1
FORMAT = "double"
MINVALUE = "0"
VALUE = "0"
}
{ COMMANDBUTTON COMMANDBUTTON1
CAPTION = "Round"
{ CLICK =
Dim lErr as Long
lErr = AmSetProperty("numbox2",amRoundUp({numbox1}))
}
{ ENABLED =
If {numbox1} <> 0.00 Then
RetVal = 1
Else
RetVal = 0
End If
}
}
{ NUMBOX NUMBOX2
FORMAT = "Double"
VALUE = "0"
}
}
{ FINISH FINISH
}
<----------------------- END CUT
Everytime I run this simple wizard, Dr Watson pops up. Anyone got any ideas how to fix this or implement a function that rounds double values to 2 decimal places? Jason Thomas
AssetCenter Consultant