Sub Globals
Dim btnAdd As Button
Dim btnRemove As Button
Dim etxQuantity As EditText
Dim quant As Int
End Sub
Sub etxQuantity_TextChanged (Old As String, New As String)
'limit EditText view to 3 digits
If New.Length > 3 Then
etxQuantity.Text = Old
'move the cursor to the end of the view
etxQuantity.SelectionStart = etxQuantity.Text.Length
End If
'make sure EditText view isn't blank, then set the value to the variable quant
If etxQuantity.Text <> "" Then
quant = etxQuantity.Text
Else
quant = 0
End If
End Sub
Sub btnAdd_Click
Dim thisContactID As cuContact
If quant > 0 Then
Msgbox("Creating fake contacts! (please be patient)", "Nice!")
For i = 1 To quant
thisContactID = cu.InsertContact("#" & DateTime.Now, "")
cu.SetNote(thisContactID.Id, "Fake contact")
Next
Else
Msgbox("Enter a quantity first.", "Hey!")
End If
End Sub