New topic: Textchange
<http://forums.realsoftware.com/viewtopic.php?t=46723> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message carlbutler7 Post subject: TextchangePosted: Sun Jan 27, 2013 12:53 pm Joined: Tue Jan 08, 2013 8:27 pm Posts: 20 Hi All this is my current code to validate a uk bank sort if sc.text="77####" then //Enter the Text bank.text="LLOYDS TSB" end if what i want; is that the # represents any number. But i have to type in hashtags (but this is where I type for example 772901 or 772902 and so on to get the same result) to get the bank.text to show the value Thanks Top DaveS Post subject: Re: TextchangePosted: Sun Jan 27, 2013 1:07 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 4468 Location: San Diego, CA Look at the MASK property of textfield _________________ Dave Sisemore MacPro, OSX Lion 10.7.4 RB2012r1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top kermit Post subject: Re: TextchangePosted: Sun Jan 27, 2013 1:17 pm Joined: Mon May 30, 2011 12:56 am Posts: 595 Quote:Hi All this is my current code to validate a uk bank sort if sc.text="77####" then //Enter the Text bank.text="LLOYDS TSB" end if Really? There are hundreds. You need to grab the UK bank sort code CD and put the codes into a database. Then you can query the data using a LIKE query, using as much as the user types in. something like this: "select bank_name from UKCODES where sort_code like '" + replace(sc.txt,"#","") + "%'" Top carlbutler7 Post subject: Re: TextchangePosted: Sun Jan 27, 2013 1:26 pm Joined: Tue Jan 08, 2013 8:27 pm Posts: 20 I'm validating the Bank Name from only the first 2 numbers in the sortcode as most bank names can be identified by these only two numbers. Top ktekinay Post subject: Re: TextchangePosted: Sun Jan 27, 2013 2:41 pm Joined: Mon Feb 05, 2007 5:21 pm Posts: 411 Location: New York, NY If you're only interested in the first two number, just look at those. if sc.text.Left( 2 ) ="77" then //Enter the Text bank.text="LLOYDS TSB" end if _________________ Kem Tekinay MacTechnologies Consulting http://www.mactechnologies.com/ Need to develop, test, and refine regular expressions? Try RegExRX. Top carlbutler7 Post subject: Re: TextchangePosted: Sun Jan 27, 2013 3:06 pm Joined: Tue Jan 08, 2013 8:27 pm Posts: 20 makes sense lovely thanks so much Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 6 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml rbforumnotifier@monkeybreadsoftware.de