I have read how to create a text file, how to insert a line and how to search for some stored data.
I have created a comma delimited text file as you can see in the image.
I look for the information with the following code in B4A
Need to be able to update a player's credits. One solution that I think would work would be to read the entire file using arrays and dump that to a new text file and then rename that new file.
Is there any other easier way to update certain data of the line that is in the text file?
Thank you, as always, for your valuable collaboration.
I have created a comma delimited text file as you can see in the image.
I look for the information with the following code in B4A
B4X:
Public Sub Func_SearchUser(user As String) As Boolean
Dim ret As Boolean=False
Dim List1 As List
List1 = File.ReadList(File.DirInternal, namearch)
For i = 0 To List1.Size - 1
Dim array() As String = Regex.Split(",",List1.Get(i))
Dim userbd=array(0)
If userbd=user Then
ret=True
Exit
Else
ret=False
End If
Next
Return ret
End Sub
Is there any other easier way to update certain data of the line that is in the text file?
Thank you, as always, for your valuable collaboration.