|
#1
|
||||
|
||||
|
Example: Using LUA's string.find & Character Ranges
Have you found a time when you needed to check for a certain number between a range of numbers? Say for example you want to see if a variable in your program (that changes often) is between say once (1) and eight (8)? Well, here is an example on how you can check such variable:
Code:
-- First define a variable to hold a random number to check against
n = 5
-- Note 'string.find' is all lower-case! It's a LUA function (not AMS created)
result = string.find(n, '[1-8]')
--[[
If there is an instance of '5' between 1 and 8, then show confirmation.
otherwise, show the second (no instances found) dialog. This is a good way
to easily check a "range" of numbers! Forum member TJ_Tigger first alerted us to this LUA innate function. Remember, type 'string.find' in all lower-case or the function will not work!
]]
if result then
Dialog.Message("", "Found at least one instance!")
else
Dialog.Message("", "Did not find any instances!")
end
|
|
#2
|
||||
|
||||
|
Finally - Something that resembles what I need to do in my project
.Intrigued, I have a problem.I'm currently working on an audio player, and i need help. its a problem between a listbox and an input object. What I need to do is this: When a user types in anything in the input box, i want that track to be selected automatically as the user types - in the end displaying (i.e:selecting) the most accurate result...I hope Ive made my problem clear so far mate.. For example, Lets assume that there are audio tracks in a list box as follows 1)Aerosmith - Jaded Aerosmith - Body Rockers - I Like the way you move Rascall Flatts-life is a highway etc,etc.... Getting Back: When the user types: "Aerosmith" - My app should automatically select that track, but if the user types "1)Aerosmith" then the selection should jump to this track...& if the User Simply types "I Like the way you move" then this track should be selected...In short - the most appropriate result should be selected I hope that my problem has been highlighted clearly and i really really hope you or any other expert could help me out here... >I know this is a lengthy reply but excuse me for that< Once again, Pls help Thanx |
|
#3
|
||||
|
||||
|
Where do you keep your playlist?
Are you using a table or something else?
__________________
Never know what life is gonna throw at you. (Based on a true story.) |
|
#4
|
||||
|
||||
|
Nice Work , Intrigued ! I hope this will help me a lot ! , Thanks
|
|
#5
|
||||
|
||||
|
Quote:
I keep my playlist in a listbox ("Playlist1")... |
|
#6
|
||||
|
||||
|
Pls Reply Guys
Hey Guys dont give up on me already
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Character Ranges - string.find - string - find | Intrigued | AutoPlay Media Studio 6.0 | 0 | 11-07-2005 07:48 PM |
| Example: Using String.Find to Locate a Substring | Corey | AutoPlay Media Studio 5.0 Examples | 0 | 11-02-2004 01:37 AM |
All times are GMT -6. The time now is 02:50 AM.








.

Linear Mode

