Publicado: 16 Abr 2013 14:41
tu no dijiste nada de decimales
Foro Especializado en Autoplay Media Studio y más...
http://amsspecialist.com/
Código: Seleccionar todo
Input.Delete("Input1");-- delete...
function IsNumeric(sValueIn)--Worm Function --I think this is a sagacity in trick!
if String.Length(string.gsub(sValueIn, "[%d.]", "")) == 0 then
return true
else
return false
end
end
bTF =IsNumeric(Input.GetText("Input1"));
if bTF then
else
Dialog.Message("Error", "Introduzca un valor numerico valido");
--Input.SetText("Input1", "");
s = Input.GetText("Input1");-- gettext
Input.SetSelection("Input1", s:len(), -1);-- selccionamos ultimo caracter
Input.Delete("Input1");-- delete...
end
Código: Seleccionar todo
[%d]%.?
+1rafaxplayer escribió:Prueba este regex :
Código: Seleccionar todo
[%d]%.?
Código: Seleccionar todo
^%-?[%d]%.?
function IsNumeric(sValueIn)--Worm Function --I think this is a sagacity in trick!
if String.Length(string.gsub(sValueIn, "^%-?[%d]%.?", "")) == 0 then
return true
else
return false
end
end
bTF =IsNumeric(Input.GetText("Input1"));
if bTF then
else
Dialog.Message("Error", "Introduzca un valor numerico valido");
s = Input.GetText("Input1");-- gettext
Input.SetSelection("Input1", s:len(), -1);-- selccionamos ultimo caracter
Input.Delete("Input1");-- delete...
end
function IsNumeric(sValueIn)--Worm Function --I think this is a sagacity in trick!
if String.Length(string.gsub(sValueIn,"[%d]%-?%.?%^?", "")) == 0 then
return true
else
return false
end
end
bTF =IsNumeric(Input.GetText("Input1"));
if bTF then
else
Dialog.Message("Error", "Introduzca un valor valido");
s = Input.GetText("Input1");-- gettext
Input.SetSelection("Input1", s:len(), -1);-- seleccionamos ultimo caracter
Input.Delete("Input1");-- delete... -- esta linea no funciona (el código no borra el valor)
end
Código: Seleccionar todo
"%d+%.?%d*"
Código: Seleccionar todo
"[-%d]+%.?%d*"