Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Edittext1 As EditText
Dim Label1 As Label
Dim Button1 As Button
Dim EditText2 As EditText
Dim Label2 As Label
Dim Label3 As Label
Dim Label4 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub newRound (Value As Double, Decimal As Byte) As Double
Dim Vorzeichen As Byte
If Value < 0 Then
Vorzeichen = -1
Else If Value > 0 Then
Vorzeichen = 1
Else If Value = 0 Then
Vorzeichen = 0
End If
Decimal = Power(10,Decimal) ' Power = 10^Decimal
Value = (Value * Decimal) + (Vorzeichen * 0.5)
Dim sma As String
sma = Value
If sma.IndexOf(".") <> -1 Then
sma = sma.SubString2(0,sma.IndexOf(".")) 'Ganzahl bilden
End If
Value = sma / 100
Return Value
End Sub
Sub Button1_Click
Dim Z As Double
Dim X As Int
Z = Edittext1.Text
X = EditText2.Text
Z= newRound(Z,X)
Label1.Text = Z
End Sub