Hello! I have a finance app I'm working on. Currently, everything works just fine. However, I would like to put these statements into a for loop if possible:
There are going to be 120 of these labels total (Called Payment1 - Payment120). I wouldn't have any problems just using tons of repetitive code, but there has to be a simpler way. All of them are going to be put into a vertical scrollview if that makes any difference to how the for loop would work. Thank you!
B4X:
If IsNumber(Payment1.Text) = False OR Payment1.Text < 0 Then
Msgbox("Please use only positive numbers and up to one decimal.","Error!")
Else
If IsNumber(Payment2.Text) = False OR Payment2.Text < 0 Then
Msgbox("Please use only positive numbers and up to one decimal.","Error!")
Else
If IsNumber(Payment3.Text) = False OR Payment3.Text < 0 Then
Msgbox("Please use only positive numbers and up to one decimal.","Error!")
Else
There are going to be 120 of these labels total (Called Payment1 - Payment120). I wouldn't have any problems just using tons of repetitive code, but there has to be a simpler way. All of them are going to be put into a vertical scrollview if that makes any difference to how the for loop would work. Thank you!