openedge - How to check if string is a palindrome in open edge progress 4gl -


how can check whether given string palindrome or not in open edge progress 4gl? there reverse string function built-in progress 4gl?

function reversestring returns character (    input i_c character ):       define variable cresult character   no-undo.    define variable ii      integer     no-undo.     ii = length( i_c ) 1 -1:       cresult = cresult + substring( i_c, ii, 1 ).    end.    return cresult.  end function.  display reversestring( "asdf" ). 

the complete openedge doc set can found here:

https://community.progress.com/community_groups/openedge_general/w/openedgegeneral/1329.openedge-product-documentation-overview.aspx

as can see, there no built-in reverse string function.

a function 1 illustrate above need.

to determine if string palindrome using function:

mystring = "asdf". if mystring = reversestring( mystring )   message "yes," mystring "is palindrome".  else   message "no," mystring "is not palindrome". 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -