home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH18LIST C:\UT2004"
- //Identifies the package
- //Decoration.uc
-
- //This class provides math functions useful for working with basic math
- class Decoration extends Commandlet;
-
- //#1
- //-------------- makeWord ----------------------------
- static function string makeWord(int A){
- return string(A);
- }
- //#2
- //--------------addDecoration--------------------------
- //Use of out allows you tranform the word without return
- public function addDecoration(out string word, string decor){
- word = decor @ word;
- word = word @ decor;
- }
- //#3
- //-------------- joinTerms ------------------------
- //Casts the arguments as a strings and returns them
- public function string joinTerms(coerce string strA, coerce string strB){
- local string exp;
- exp = strA @ "and" @ strB;
- return exp;
- }
- //#4
- //-------------- addSpace ----------------------------
- //The sectond argument, for number of spaces, is optional
- //The function defaults to 1
- //#2
- public function string addSpace(string expression, optional int spaces){
- local int iLoc, iCtr;;
- local string szExp, szSpace;
- iLoc = 0; iCtr = 0;
- if(spaces <=0){spaces = 1;}
- while(iCtr < spaces){
- szSpace $= "-";
- iCtr++;
- }
-
- while(iLoc <= Len(expression)){
- //Log(Left( expression, iLoc));
- szExp $= Right( Left( expression, iLoc) , 1) ;
- szExp $= szSpace;
- //szExp $= "-";
- iLoc++;
- }
- return szExp;
- }
-
-
-
-
-
-
-