My application sometimes requires users to replace an entry while the app is running. I have the following code to try to accomplish that but the code still continues after the message box is closed, thus preventing a new entry in an edittext box. Maybe someone can tell me how to work around this. Neither 'exit' nor 'return' does the job. It would be ideal if the issue could be handled immediately after making the original entry in the edittext box and prior to tapping OK. Thanks very much.
Jim Schuchert
B4X:
Sub btnOK_click
main.strpointno = txtTo.Text
generalsubs.pointprotect
.
.
.
.
end sub
B4X:
Sub pointprotect
Dim reader As TextReader
reader.Initialize (File.openinput(File.DirInternal, main.strfilename))
Dim lineoftext As String
Dim cline()
lineoftext = reader.ReadLine ' get the first line
Do While lineoftext<> Null
cline = Regex.Split(",", lineoftext)
If cline(0) = main.strpointno Then
Msgbox("Point " & main.strpointno & " has been used. Please select another","msg")
'Return
Exit
End If
lineoftext=reader.ReadLine
Loop
End Sub
Jim Schuchert