April 28, 2010

InstallScript - Reversing Input String

Here is the InstallScript function to reverse the input string and return the reversed string.

///////////////////////////////////////////////////////////////////////////////

// StrReverse()
// Description: This function reverses the input string
//////////////////////////////////////////////////////////////////////////////
function STRING StrReverse(svStr)
         string szReversedString;
         number nLen, nCnt;
begin
         nLen = StrLength(svStr) - 1;
         for nCnt = 0 to nLen
                szReversedString[nCnt] = svStr[nLen - nCnt];
         endfor;
         return szReversedString;
end; // End of StrReverse

No comments:

Post a Comment