In this recipe, you will learn how to translate standard text into Pig Latin. To accomplish this task, you will ask the user for an English word, determine if the word starts with a vowel or not, and then convert the word to Pig Latin in two steps.
Note
Pig Latin words are formed by modifying English words. The first consonant of an English word is moved to the end of the word and "ay" is added as a suffix. If the word begins with a vowel, then it is modified only by adding the suffix "ay." So, "LiveCode" would become "iveCodelay".
While you might never need to use Pig Latin in the mobile apps you develop, this recipe shows some of LiveCode's powerful text controls:
Create a new main stack in LiveCode.
Create a button with the name
pigLatin
.Add the following code to the pigLatin button:
on mouseUp local englishWord, pigLatinWord, tLetter ask question "Enter an English word" titled "Word Entry" put it into englishWord put englishWord into...