;--------------------------------------------------------------------------
; Procedure  : EndStr(String, Num)
; Description: Return the last Num characters from String
;--------------------------------------------------------------------------
PROC EndStr(String, Num)
Return SUBSTR(String,LEN(String)-Num+1,Num)
ENDPROC

The intent of EndStr() is to return the last Num characters from a given string. I have used
it in building unique keys for an order entry system, consisting of three alpha and two numbers
zero filled to the left: DDD01, for example. The number is incremented for each new instance
of the alpha code, to make the whole key unique. To do that, I had to find the highest existing
instance, strip off the number, increment, and put it back. This led to the discovery that
Paradox will not address substrings as an offset from the end. Unisys Mapper allows me to do it by
specifying a start position of zero to count the parameter number of characters back from the end 
of the string. In Mapper, if StringName = "Archibald" then StringName(0,4) = "bald". I don't know
if this is a big thing to anyone except me, but this works and it feels elegant, so ...
 
