inputdialog string

wegmanjunior

New Member
hello, so i made this little piece of code, but in the last dialog, the number dialog, whatever i type in in the first 2 inputdialogs, it always shows: "Okay, -1 -1 Set Password"
B4X:
Sub makenewbutton_Click
Dim nameinput As InputDialog
Dim name As String
name = nameinput.Show("name?", "insert name", "Ok", "", "", Null)

Dim surnameinput As InputDialog
Dim surname As String
surname = surnameinput.Show("surname?", "insert surname", "Ok", "", "", Null)

Dim nd As NumberDialog
Dim pass As Long
nd.Digits = 4
nd.Number = 0000
nd.Decimal = 0
nd.ShowSign = False
pass = nd.Show("Okay, " & name & surname & " Set Password", "Ok", "Cancel", "", Null)
End Sub

Please help
 
Last edited:

Kevin

Well-Known Member
Licensed User
Longtime User
You are assigning the result of the dialog's buttons (OK,cancel, etc) to what you think is the text put in by the user.

B4X:
Dim nameinput As InputDialog, name as String

If nameinput.Show ("name?", "insert name", "Ok", "", "", Null) = DialogResponse.Cancel Then Return
name = nameinput.Input

Note that the above code may not be 100% correct but should hopefully point you in the right direction. I don't have access to B4A right now.
 
Upvote 0
Top