#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
#End Region
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private EditText1 As EditText
Dim a As String
Private EditText2 As EditText
Private Button2 As Button
Private EditText3 As EditText
End Sub
Public Sub Initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
If File.exists(File.DirInternal, "chiavi.txt" ) Then
a = File.ReadString(File.DirInternal, "chiavi.txt")
EditText3.Text= a
Else
File.WriteString(File.DirInternal, "chiavi.txt","")
End If
End Sub
Private Sub Button1_Click
File.WriteString(File.DirInternal, "chiavi.txt", a & CRLF & EditText1.text)
Sleep(200)
a = File.Readstring(File.DirInternal, "chiavi.txt")
EditText3.Text=a
Log(a)
End Sub
Private Sub EditText1_TextChanged (Old As String, New As String)
For Each line As String In File.Readlist(File.DirInternal,"chiavi.txt")
If line.trim.ToUpperCase.Contains(EditText1.Text.trim.ToUpperCase) Or line.trim.ToUpperCase.startswith(EditText1.Text.trim.ToUpperCase) Then
EditText2.Text= EditText2.Text & CRLF & line
Log(EditText2.Text)
End If
Next
If EditText1.Text="".Trim Then
EditText2.Text="".Trim
End If
End Sub
Private Sub Button2_Click
File.WriteString(File.DirInternal, "chiavi.txt", "")
End Sub