First layout
........................................................
'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim equationmaxpower As EditText
Dim maxpowr As Double
Dim coefficient As Double
'Dim resultss As Double
Dim i As Double
Dim cofx() As Double
Dim coDfx() As Double
Dim a As Double
Dim maxpowrDfx As Double
'Dim eps As Double 'epsilon
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("findrootLayout")
End Sub
Sub findrootButton_Click
If equationmaxpower.Text = "" Then
Msgbox("Insert a value","")
Return
Else
If equationmaxpower.Text = 0 Then
Msgbox("Insert a value more than 0","")
Return
Else
If Not(equationmaxpower.Text = "") Then
maxpowr = equationmaxpower.Text
coefficient = maxpowr + 1
Dim cofx(maxpowr) As Double
Dim coDfx(maxpowr - 1) As Double
coDfx(0) = 0
For i = 0 To maxpowr
StartActivity(Submain)
a = Submain.coefficient2
cofx(i) = a
Next
maxpowrDfx = maxpowr - 1
For i = 0 To maxpowrDfx
coDfx(i) = cofx(i) * (maxpowr - i)
Next
' eps = 1
' While eps + 1 > 1
'eps = eps / 2
'End While
'resultss = results(eps, cofx, coDfx, maxpowr, maxpowrDfx)
'root.Text = resultss
End If
End If
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
............................................................
Below is the second layout.
............................................................
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim coefficient2 As Double
coefficient2=""
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 coefficient As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("2")
End Sub
Sub next_Click
If coefficient.Text = "" Then
Msgbox("Insert a value","")
End If
If Not (coefficient.Text = "") Then
coefficient2= coefficient.Text
StartActivity(Main)
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
....................................................................
The emulator said "The application find root (process awaken.findRoot0 has stopped unexpectedly.Please try again"
........................................................
'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim equationmaxpower As EditText
Dim maxpowr As Double
Dim coefficient As Double
'Dim resultss As Double
Dim i As Double
Dim cofx() As Double
Dim coDfx() As Double
Dim a As Double
Dim maxpowrDfx As Double
'Dim eps As Double 'epsilon
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("findrootLayout")
End Sub
Sub findrootButton_Click
If equationmaxpower.Text = "" Then
Msgbox("Insert a value","")
Return
Else
If equationmaxpower.Text = 0 Then
Msgbox("Insert a value more than 0","")
Return
Else
If Not(equationmaxpower.Text = "") Then
maxpowr = equationmaxpower.Text
coefficient = maxpowr + 1
Dim cofx(maxpowr) As Double
Dim coDfx(maxpowr - 1) As Double
coDfx(0) = 0
For i = 0 To maxpowr
StartActivity(Submain)
a = Submain.coefficient2
cofx(i) = a
Next
maxpowrDfx = maxpowr - 1
For i = 0 To maxpowrDfx
coDfx(i) = cofx(i) * (maxpowr - i)
Next
' eps = 1
' While eps + 1 > 1
'eps = eps / 2
'End While
'resultss = results(eps, cofx, coDfx, maxpowr, maxpowrDfx)
'root.Text = resultss
End If
End If
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
............................................................
Below is the second layout.
............................................................
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim coefficient2 As Double
coefficient2=""
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 coefficient As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("2")
End Sub
Sub next_Click
If coefficient.Text = "" Then
Msgbox("Insert a value","")
End If
If Not (coefficient.Text = "") Then
coefficient2= coefficient.Text
StartActivity(Main)
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
....................................................................
The emulator said "The application find root (process awaken.findRoot0 has stopped unexpectedly.Please try again"