#NEWLINE# def onClick( self , sender ) : #NEWLINE# #INDENT# phrase = self . tb . getText ( ) #NEWLINE# currTime = time ( ) #NEWLINE# self . db . execute ( 'insert into Demo values (?, ?)' , phrase , currTime ) #NEWLINE# rs = self . db . execute ( 'select * from Demo order by Timestamp desc' ) #NEWLINE# index = 0 #NEWLINE# while rs . isValidRow ( ) : #NEWLINE# #INDENT# if ( index < 4 ) : #NEWLINE# #INDENT# self . g . setHTML ( currTime , 0 , rs . field ( 0 ) ) #NEWLINE# self . g . setHTML ( index , 1 , rs . field ( 1 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . db . execute ( 'delete from Demo where Timestamp=?' , rs . field ( 1 ) ) #NEWLINE# #UNINDENT# index += 1 #NEWLINE# rs . next ( ) #NEWLINE# #UNINDENT# rs . close ( )