iOS Question android to ios

Enthousiastic

Active Member
Licensed User
Hello , i am beginner to b4i and i study it learning from user guide slowly-slowly. A database that i made in b4a i want to write it to b4i. I have two questions.

a) In attached file there is code in b4a i want the subs LoadRecords , btn_First , btn_Last , btn_Prev , btn_Next to write the coresponding code in b4i

b) In the b4i Table class there is not a sub to load an sql like in b4a as follows :

Public Sub LoadSQLiteDB(SQLite As SQL, Query As String, AutomaticWidths As Boolean)
Dim Curs As Cursor
Curs = SQLite.ExecQuery(Query)

cAutomaticWidths = AutomaticWidths
NumberOfColumns = Curs.ColumnCount
innerClearAll(NumberOfColumns)

Dim Headers(NumberOfColumns) As String
Dim ColumnWidths(NumberOfColumns) As Int
Dim HeaderWidths(NumberOfColumns) As Int
Dim DataWidths(NumberOfColumns) As Int
Dim col, row As Int
Dim str As String
For col = 0 To NumberOfColumns - 1
Headers(col) = Curs.GetColumnName(col)
If AutomaticWidths = False Then
ColumnWidths(col) = 130dip
HeaderWidths(col) = 130dip
DataWidths(col) = 130dip
Else
HeaderWidths(col) = cvs.MeasureStringWidth(Headers(col), Typeface.DEFAULT, cTextSize) + 8dip
DataWidths(col) = 0
For row = 0 To Curs.RowCount - 1
Curs.Position = row
str = Curs.GetString2(col)
If str <> Null Then
DataWidths(col) = Max(DataWidths(col), cvs.MeasureStringWidth(str, Typeface.DEFAULT, cTextSize) + 8dip)
End If
Next
ColumnWidths(col) = Max(HeaderWidths(col), DataWidths(col))
End If
Next
SetHeader(Headers)
SetColumnsWidths(ColumnWidths)

For row = 0 To Curs.RowCount - 1
Dim R(NumberOfColumns), str As String
For col = 0 To NumberOfColumns - 1
Curs.Position = row
str = Curs.GetString2(col)
If str <> Null Then
R(col) = str
Else
R(col) = ""
End If
Next
AddRow(R)
Next

Curs.Close
End Sub

What is the corresponding code in a) and b) for b4i ?
Your answer will be very helpfull because i can't go on and is very critical for me.
Many thanks to all guys in the forum

Enthousiastic
 

Attachments

  • loadrecords.zip
    14.9 KB · Views: 118
Top