|
#1
|
|||
|
|||
|
Function: Filter Key Press for On Key Event
Just a little function I threw together to filter allowed characters in a input box.
Code:
function FilterKeyPress(InputObject, e_Key, sAllowed) sOrig = Input.GetText(InputObject) sFilter = String.TrimLeft(sOrig, sAllowed) sFilteredLeft = String.TrimLeft(sOrig, sFilter) sFilteredRight = String.TrimRight(sFilteredLeft, sFilter) Input.SetText(InputObject, sFilteredRight) Input.SetSelection(InputObject, String.Length(Input.GetText(InputObject)) + 1, String.Length(Input.GetText(InputObject))) end Code:
-- allow only numerics FilterKeyPress(this, e_Key, "1234567890") Code:
-- allow only Capital Letters FilterKeyPress(this, e_Key, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") |
|
#2
|
||||
|
||||
|
Good one, thanks Worm. This looks like one that will probably come in handy some time.
I don’t want to brag, but given enough time, I probably could have written a 30+ line function, that could do nearly the same thing. Additionally, mine would only have a couple of small, and rarely encountered bugs. Maybe if I keep with this programming stuff long enough, I too can be lazy like that, and cram 30 + lines of code down to 8 or so. Then again, customers would probably put a higher value on my 8.4MB program, than they would on your 1.3MB program. And they should, because I can guarantee that it would take me longer to write my 8.4MB program, than you’d spend writing a 1.3MB program, even if your program had more features, and didn’t crash like mine does, on months with 31 days. Thanks again Man!
__________________
Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more. Visit Acme-Tek |
|
#3
|
||||
|
||||
|
This is why I also request for the addition into of AMS for checking patterns. (aka. 0-9, a-z, A-Z). Lua support this, we just need AMS to catch up via an Action for this basic but important, useful activity.
|
|
#4
|
||||
|
||||
|
You mean like supporting regexp? It's built into lua, so it's already there in autoplay.
See string.find(), string.gfind(), etc.
__________________
--[[ Indigo Rose Software Developer ]] |
|
#5
|
||||
|
||||
|
I did not have ultimate success with Patterns, it may have been my fault or?:
Quote:
|
|
#6
|
||||
|
||||
|
regexp patterns can be tricky to learn. That's why there isn't an IR action for it. It's built in, and it works, but if you don't already know how to do regexp searches...it's way beyond what we can reasonably support.
__________________
--[[ Indigo Rose Software Developer ]] |
|
#7
|
||||
|
||||
|
Find a good UNIX book. They usually have a chapter on how to use regular expressions. They come in quite handy.
Tigg
__________________
TJ-Tigger "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." "Draco dormiens nunquam titillandus." Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine |
|
#8
|
||||
|
||||
|
Quote:
|
|
#9
|
||||
|
||||
|
Hey! Thanks a lot Worm! I worked a long time to have something different, but with the same goal, to work, so I'll probably learn a lot from this!
Thanks again FoxLeader |
|
#10
|
|||
|
|||
|
does anybody knows how i can get a pagejump when
3 images are visable on a page can someone please help me with this it's like i can't sleep untill i get it done and i tried untill i fell in sleep on my keyboard so please help me....... thanx |
|
#11
|
||||
|
||||
|
.apz pls
|
|
#12
|
||||
|
||||
|
Quote:
1. create a new empty project 2. add the following code to the "On Preload" of Page1: Code:
Page.StartTimer(100) Code:
if Image.IsVisible("Image1") and Image.IsVisible("Image2") and Image.IsVisible("Image3") then
Page.Jump("Page2")
end
5. add a second page to the project (will be named Page2 by default) 6. add a Lable object and set it's text to "Page 2" 7. click the F5 (Preview) toolbar button to view the project. It should page jump to Page2, right away. |
|
#13
|
|||
|
|||
|
fixed
thanx intrigued
i already thought that i asked for something that was imposseble i just got home so i'm going to try it out right away... you really helped me out.... |
|
#14
|
|||
|
|||
|
**** your good
i just tried it and it works perfectly took me a minute with your help |
|
#15
|
||||
|
||||
|
this function is not working on AMS ver. 7.0
onKey I have Code:
FilterKeyPress(this, e_Key, "0123456789,-") |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using a slider to show audio posiion in time | Randy3265 | AutoPlay Media Studio 5.0 | 16 | 01-07-2006 09:34 AM |
| Unable to find software? | NigelLacey | Visual Patch 2.0 | 4 | 10-11-2005 11:35 AM |
| Another tough one... Interaction between Web and AMS | Agent Jones | AutoPlay Media Studio 5.0 | 13 | 08-18-2005 03:10 PM |
| How can I know the FS Command name of a movie??? | yoske | AutoPlay Media Studio 5.0 | 27 | 01-01-2005 11:39 PM |
| Responding to Key Presses | Desmond | AutoPlay Media Studio 5.0 Examples | 0 | 09-26-2003 10:49 AM |
All times are GMT -6. The time now is 03:42 AM.









Linear Mode

