' REVERSE$(0.0)  Reverse Character String                  03/17/1997-02/09/2010
' ------------------------------------------------------------------------------
' Copyright (C) 1997-2010 by Vladimir Veytsel                      www.davar.net

' Type -------------------------------------------------------------------------

'    Function

' Parameter --------------------------------------------------------------------

'    Strng$  - Character string to be reversed

' Value ------------------------------------------------------------------------

'    Character string of the same length as parameter string with characters
'    in the reverse order.

' Examples ---------------------------------------------------------------------

'    REVERSE$("")   =""
'    REVERSE$("A")  ="A"
'    REVERSE$("AB") ="BA"
'    REVERSE$("ABC")="CBA"

' Start Function ---------------------------------------------------------------

     DEFINT A-Z  ' All defaulted variables are integer

     FUNCTION REVERSE$(Strng$)

' Form and Return Function Value to the Point of Invocation --------------------

     FOR I=LEN(Strng$) TO 1 STEP -1
         Target$=Target$+MID$(Strng$,I,1)
     NEXT I
     REVERSE$=Target$

' Finish Function --------------------------------------------------------------

     END FUNCTION