Indigo Rose Software
  #1  
Old 08-13-2006
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Lightbulb Example: Remove Spaces - Input object

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.

Code:
--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/...-Intrigued.apz
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #2  
Old 11-14-2006
Mikhail Mikhail is online now
Forum Member
 
Join Date: Aug 2004
Location: Rio de Janeiro, Brasil
Posts: 61
Lightbulb

Quote:
Originally Posted by Intrigued View Post
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.

Thanks! Another version:

Code:
--The number '32' equals the ASCII Decimal SPACE
if e_Key == 32 then
strCache = Input.GetText(this);
local strCache = String.Replace(strCache, " ", "", false);
local strCacheLength = String.Length(strCache);
Input.SetText(this, strCache);
Input.SetSelection(this, strCacheLength + 1, strCacheLength + 1);
end
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Input object loses focus after Internet dthompson16 AutoPlay Media Studio 5.0 6 08-26-2004 08:55 AM
Input object graying out dthompson16 AutoPlay Media Studio 5.0 7 07-28-2004 08:28 PM
Function: Test Whether An Input Object Is Empty Lorne AutoPlay Media Studio 5.0 Examples 0 06-08-2004 03:18 PM
INFO: Difference between the Media Player Object and the AVI Object Support AutoPlay Media Studio 4.0 Examples 0 10-29-2002 03:15 PM
HOWTO: Make a Media Player Object Go Full Screen Support AutoPlay Media Studio 4.0 Examples 0 10-23-2002 12:23 PM


All times are GMT -6. The time now is 11:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software