Intrigued
08-13-2006, 06:02 PM
The following is code that will allow for the "real-time" removal of spaces in an Input object.
Note: Change the Input object names as needed
Add this code to the On Key of the intended Input object.
--The number '32' equals the ASCII Decimal SPACE
if e_Key == 32 then
strInput1 = Input.GetText("Input1")
strInput1 = String.Replace(strInput1, " ", "", false)
strInput1Length = String.Length(strInput1)
Input.SetText("Input1", strInput1)
Input.SetSelection("Input1", strInput1Length+1, strInput1Length+1)
end
Here is an exported project file, example:
http://www.amsuser.com/ams/examples/InputValidate-AMS6-Intrigued.apz
Note: Change the Input object names as needed
Add this code to the On Key of the intended Input object.
--The number '32' equals the ASCII Decimal SPACE
if e_Key == 32 then
strInput1 = Input.GetText("Input1")
strInput1 = String.Replace(strInput1, " ", "", false)
strInput1Length = String.Length(strInput1)
Input.SetText("Input1", strInput1)
Input.SetSelection("Input1", strInput1Length+1, strInput1Length+1)
end
Here is an exported project file, example:
http://www.amsuser.com/ams/examples/InputValidate-AMS6-Intrigued.apz