' If Starter.UID = " " we have to register the user
If Starter.UID = " " Then
' First start ever
Dim NickChosen As String = ""
Message = "Choose your nick name"
Dim NickOK, CloseAppSelected As Boolean = False
Do While Not(NickOK) And Not(CloseAppSelected)
Dim idlg As InputDialog
Dim sf As Object = idlg.ShowAsync("", "Choose your nick name", "Ok", "", "Close app", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.NEGATIVE Then
CloseAppSelected = True
Else
NickChosen = idlg.Input
If NickChosen.Length > mNickMaxLen Then
NickChosen = ""
ToastMessageShow("Nick name max lengh is " & mNickMaxLen, True)
Else
Wait For (Registration(NickChosen)) complete(RegRes As Int)
Select RegRes
Case REGISNICK_INVALID
ToastMessageShow("Invalid nick", True)
Case REGISNICK_NICK_FOUND
ToastMessageShow("Nick name " & NickChosen & " already exists", True)
Case REGISNICK_OK
NickOK = True
Case REGISNICK_OTHER
ToastMessageShow("Error trying to insert your nick name; please, try again", True)
End Select
End If
End If
Loop
If CloseAppSelected Then
CallSubDelayed(Me, "CloseApp")
Return
End If
lblWelcome.Text = "Welcome, " & Starter.Nick
lblWelcome.Visible = True
' SetDB
CallSubDelayed(Me, "SetDB")
Else
lblWelcome.Text = "Welcome, " & Starter.Nick
lblWelcome.Visible = True
' SetDB
CallSubDelayed(Me, "SetDB")
End If
End Sub