Returns the characters in a string in reverse order.
The following WRITE commands shows the return value from $REVERSE. The first returns “CBA”, the second returns 321.
You can use the $REVERSE function with other functions to perform search operations from the end of the string. The following example demonstrates how you can use $REVERSE with the $FIND and $LENGTH functions to locate the last example of a string within a line of text. It returns the position of that string as 33:
SET line="THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG."
WRITE "The last THE in the line begins at ",position