Changes between Version 2 and Version 3 of QuickStart/2:ModellingourApplication
- Timestamp:
- 04/27/09 14:36:35 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QuickStart/2:ModellingourApplication
v2 v3 11 11 12 12 <cffunction name="init" returntype="any" access="public" output="false"> 13 <cfargument name="vowels" type="string" required="true" />13 <cfargument name="vowels" type="string" required="true" /> 14 14 15 <cfset variables.vowels = arguments.vowels />15 <cfset variables.vowels = arguments.vowels /> 16 16 17 <cfreturn this />17 <cfreturn this /> 18 18 </cffunction> 19 19 20 20 <cffunction name="translate" returntype="string" access="public" output="false"> 21 <cfargument name="phrase" />21 <cfargument name="phrase" /> 22 22 23 <cfset var firstVowel = reFindNoCase("[#variables.vowels#]", arguments.phrase) - 1/>24 <cfset var result = trim(arguments.phrase) />23 <cfset var firstVowel = reFindNoCase("[#variables.vowels#]", arguments.phrase) - 1/> 24 <cfset var result = trim(arguments.phrase) /> 25 25 26 <!--- We started with a consonant --->27 <cfif len(result) and firstVowel gt 0>28 <cfset result = right(arguments.phrase, len(arguments.phrase) - firstVowel)29 & left(arguments.phrase, firstVowel) & "ay" />30 <!--- We started with a vowel --->31 <cfelseif len(result)>32 <cfset result = result & "ay" />33 </cfif>26 <!--- We started with a consonant ---> 27 <cfif len(result) and firstVowel gt 0> 28 <cfset result = right(arguments.phrase, len(arguments.phrase) - firstVowel) 29 & left(arguments.phrase, firstVowel) & "ay" /> 30 <!--- We started with a vowel ---> 31 <cfelseif len(result)> 32 <cfset result = result & "ay" /> 33 </cfif> 34 34 35 <cfreturn result />35 <cfreturn result /> 36 36 </cffunction> 37 37
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)