Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Dim btnForAll As Button
Dim ButtonAddNotes As Button
Dim ButtonReadNotes As Button
Dim TextField As EditText 'your Text field where you will write notes
Dim MemberID As String 'or string if your number begins like 007,008 etc...
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("cdtom")
MemberID = "007"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub ButtonAddNotes_Click
File.WriteString(File.DirRootExternal, MemberID&".txt",TextField.Text)'it writes text from text field into memberId.txt file example 007.txt
ToastMessageShow("File " &MemberID&".txt saved. WRITE",False)
TextField.Text = "" 'just to empty edittext box
TextField.Visible = False 'put edittext visible to false
End Sub
Sub ButtonReadNotes_Click
TextField.Text = "" 'just empty text if has left something inside it
TextField.Visible = True 'show edit text
ToastMessageShow("Load " &MemberID&".txt. READ",False)
TextField.Text = File.ReadString(File.DirRootExternal, MemberID&".txt") ' it reads from text file memberid.txt example 007.txt and it shows under text field
End Sub
Sub btnForAll_Click
If TextField.Visible = False Then
TextField.Visible = True
ButtonReadNotes_Click
Else
ButtonAddNotes_Click
End If
End Sub