#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
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
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
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
'EditText2.Text=a
Else
File.WriteString(File.DirInternal, "chiavi.txt","")
End If
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
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