DEFINE VARIABLE a AS CHARACTER NO-UNDO.
DEFINE VARIABLE b AS CHARACTER NO-UNDO.
a = '633598642076131250'.
b = IF LENGTH(a) GT 3 THEN SUBSTRING(a,LENGTH(a) - 3) ELSE a.
MESSAGE b VIEW-AS ALERT-BOX.
That way it will not "die" when the string gets shorter than the required 4 characters. Also note that you do not *have* to specify the 4 as you are after the last x characters anyway.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.