Checking a textField against a list of permitted characters

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Checking a textField against a list of permitted characters

Post by richmond62 »

This stack contains 3 fields: fORIGIN, fLIST and fOUTPUT

fLIST contains the list of permitted characters (in this case the consonants of the English alphabet).

The button will "bite" the first character from the string in fld fORIGIN and if it matches one of the letters in fld fLIST put it into fld 'fOUTPUT

This is horribly primitive and needs a REPEAT loop, but it proves its point.
LC_gadfly.png
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Checking a textField against a list of permitted charact

Post by richmond62 »

Here's a cleaned-up version, with a repeat loop.

There is an option to perform using fields

and

an option to use strings (which should, with great long strings be quicker).
Attachments
char_limiter.livecode.zip
Newer version.
(15.39 KiB) Downloaded 321 times
Post Reply