Scott_Kahn
(Scott Kahn)
October 21, 2024, 6:21pm
1
Hi. I have a text field in which users enter a value for the quantity they want something printed.
I need to convert TextField_qty.text to an integer so that I can act upon it properly in a printing loop.
What’s the simplest way to achieve this?
Thanks!
Hi Scott,
Try the “Val” method: Val — Xojo documentation
AlbertoD
(AlbertoD)
October 21, 2024, 6:25pm
3
Scott Kahn:
TextField_qty.text
You can try:
Var myInteger as Integer = TextField_qty.text.ToInteger
1 Like
Scott_C
(Scott C)
October 21, 2024, 6:27pm
4
Maybe add in a check to make sure it is a number first
If TextField_qty.Text.IsNumeric Then
// your preferred conversion method
End If
2 Likes
Scott_Kahn
(Scott Kahn)
October 21, 2024, 6:36pm
5
Thanks folks!
TextField_qty.text.ToInteger is what I needed, and useful tip from Scott C.