Script 1:
Code: Select all
@REQUIRE "RapaGUI", { Link = True }
Local ret$, ok = StringRequest("Current syntax", "You should only be able to enter numercial characters:", { type = #NUMERICAL })
If ok
SystemRequest("Your input", ret$, "OK")
EndIf
ret$, ok = StringRequest("Deprecated syntax", "You should only be able to enter numercial characters:", "", #NUMERICAL)
If ok
SystemRequest("Your input", ret$, "OK")
EndIf
Code: Select all
Local ret$, ok = StringRequest("Current syntax", "You should only be able to enter numercial characters:", { type = #NUMERICAL })
If ok
SystemRequest("Your input", ret$, "OK")
EndIf
ret$, ok = StringRequest("Deprecated syntax", "You should only be able to enter numercial characters:", "", #NUMERICAL)
If ok
SystemRequest("Your input", ret$, "OK")
EndIf
Windows:
- Script 1: type = #NUMERICAL is ignored
- Script 2: works as expected: only 0-9 can be entered plus 0 or 1 dot as decimal separator
- Script 1: type = #NUMERICAL is ignored
- Script 2: only 0-9 can be entered plus 0 or 1 dot as decimal separator, but as soon as the focus leaves the textentry, the number is rounded to an integer
- Script 1 + 2: type = #NUMERICAL is not ignored, but it's not possible to enter a dot as decimal separator
Cheers, Michael