Everything works fine, but I have to do the “for w, do” multiple times for different symbols (maybe a total of 10 symbols or so). As I’m pretty sure that these are globals and slow down my application, is there a way to add an if/then statement saying if the input is not a number or a + or - sign then delete the entry?
second question
With the below method (when testing on device), when it deletes letters it also moves the position of the flashing vertical bar (that tells you where your next character will appear). So that if they typed 4a, the a will delete and the flashing bar will appear before the 4. Any way to make the flashing bar shift over?
[lua]
if ( “editing” == event.phase ) then
for w in string.gmatch(input1.text, “%a”) do
input1.text = string.gsub(input1.text, “%a”, “”)
print (“getting rid of letters”)
–native.setKeyboardFocus( input1 )
end
for w in string.gmatch(input1.text, “%s”) do
input1.text = string.gsub(input1.text, “%s”, “”)
print (“getting rid of space”)
end
end
[/lua]