Sub nex_Click
Dim WeekDaysStr() As String
WeekDaysStr = Array As String ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
' This on nex_Click changes day name on Label5 randomly when used with the Previous_Click button
dadate.text= WeekDaysStr(DateTime.GetDayOfWeek(DateTime.Now) - i)
' This on nex_Click changes day name to a number
' dadate.text= DateTime.GetDayOfWeek(DateTime.Now) - 1
' Edited
The rest of Sub nex_Click using variable i does step through the 3 records in the database using a nex and a previous button..
B4X:
'Log ("B4 If " & (i))
If i <= 1 Then
i = i + 1
End If
Cursor1 = SQL1.ExecQuery("SELECT * FROM Names")
Cursor1.Position = i 'example location3 'set the cursor
EditText1.Text = Cursor1.GetString("First name") 'read the value of the FirstName column
EditText2.Text = Cursor1.GetString("Name") 'read the value of the LasstName column
Cursor1.Close
Log ("AFTER If " & (i))
End Sub
How would I get Label5 to show the day name changes as the dB changes? :bangs head:
'Log ("B4 If " & (i))
If i <= 1 Then
i = i + 1
End If
Cursor1 = SQL1.ExecQuery("SELECT * FROM Names")
Cursor1.Position = i 'example location3 'set the cursor
EditText1.Text = Cursor1.GetString("First name") 'read the value of the FirstName column
EditText2.Text = Cursor1.GetString("Name") 'read the value of the LasstName column
Cursor1.Close
Log ("AFTER If " & (i))
End Sub
'Log ("B4 If " & (i))
If i <= 1 Then
i = i + 1
End If
Cursor1 = SQL1.ExecQuery("SELECT * FROM Names")
Cursor1.Position = i 'example location3 'set the cursor
EditText1.Text = Cursor1.GetString("First name") 'read the value of the FirstName column
EditText2.Text = Cursor1.GetString("Name") 'read the value of the LasstName column
Cursor1.Close
Log ("AFTER If " & (i))
End Sub
That's '(Cursor1.Position =i) ' , the ninth letter, a variable that gets incremented or decremented to Get the next or previous recordset in a database. That code words, it's Label5 which shows GetDayOfWeek that I want to update as the database does it's Next and Previous things.
thanks for the pointers , the label updating code is :banghead intense ( to me ) and very helpful.
I'm going to work on merging it into my pre-alpha activity module.
ps: I'm thinking that Timer1 is not needed since I will use DateTime.GetDayOfWeek(DateTime.Now) to get the current day. Yes /No?
B4a is starting to seem like pouring water into a glass , the more I learn and the more water I pour in ~ the larger the glass gets