RosettaCodeData/Task/Reverse-a-string/OpenEdge-Progress/reverse-a-string.openedge
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

15 lines
358 B
Text

FUNCTION reverseString RETURNS CHARACTER (
INPUT i_c AS CHARACTER
):
DEFINE VARIABLE cresult AS CHARACTER NO-UNDO.
DEFINE VARIABLE ii AS INTEGER NO-UNDO.
DO ii = LENGTH( i_c ) TO 1 BY -1:
cresult = cresult + SUBSTRING( i_c, ii, 1 ).
END.
RETURN cresult.
END FUNCTION.
MESSAGE reverseString( "asdf" ) VIEW-AS ALERT-BOX.