Indigo Rose Software
  #1  
Old 11-07-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
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
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #2  
Old 05-03-2007
SiNisTer's Avatar
SiNisTer SiNisTer is offline
Forum Member
 
Join Date: Mar 2007
Posts: 186
Peekaboo!

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
Reply With Quote
  #3  
Old 05-03-2007
bule's Avatar
bule bule is offline
Indigo Rose Customer
 
Join Date: May 2005
Posts: 1,147
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.)
Reply With Quote
  #4  
Old 05-03-2007
CrazyFrog's Avatar
CrazyFrog CrazyFrog is offline
Forum Member
 
Join Date: Jan 2007
Location: Resita ( Romania )
Posts: 118
Nice Work , Intrigued ! I hope this will help me a lot ! , Thanks
Reply With Quote
  #5  
Old 05-03-2007
SiNisTer's Avatar
SiNisTer SiNisTer is offline
Forum Member
 
Join Date: Mar 2007
Posts: 186
Quote:
Originally Posted by bule View Post
Where do you keep your playlist?
Are you using a table or something else?

I keep my playlist in a listbox ("Playlist1")...
Reply With Quote
  #6  
Old 05-06-2007
SiNisTer's Avatar
SiNisTer SiNisTer is offline
Forum Member
 
Join Date: Mar 2007
Posts: 186
Pls Reply Guys

Hey Guys dont give up on me already ...I really wish someone could assist me here...
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
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.


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