#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
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 sql1 As SQL
Dim lbl1, lbl2 As Label
Dim lbl3, lbl4 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim n1, n2 As Double
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
sql1.Initialize(File.DirDefaultExternal, "test.db",True)
sql1.ExecNonQuery("drop table if exists tmp")
sql1.ExecNonQuery("create table tmp (num1 real, num2 real)")
'result<100000
lbl1.Initialize("")
lbl2.Initialize("")
n1=100.01
n2=99.001
sql1.ExecNonQuery("delete from tmp ")
sql1.ExecNonQuery("insert into tmp (num1, num2) select " & n1 & "," & n2)
lbl1.Text=n1*n2
lbl2.Text=sql1.ExecQuerySingleResult("Select num1*num2 from tmp")
Activity.AddView(lbl1,0,0,50%x,60dip)
Activity.AddView(lbl2,0,60dip,50%x,60dip)
'result>100000
lbl3.Initialize("")
lbl4.Initialize("")
n1=100.9
n2=1000.11
sql1.ExecNonQuery("delete from tmp ")
sql1.ExecNonQuery("insert into tmp (num1, num2) select " & n1 & "," & n2)
lbl3.Text=n1*n2
lbl4.Text=sql1.ExecQuerySingleResult("Select num1*num2 from tmp")
Activity.AddView(lbl3,50%x,0,50%x,60dip)
Activity.AddView(lbl4,50%x,60dip,50%x,60dip)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub