If the original string is left-justified and blank filled into a larger string field, then the ALLTRMCHR() does not work as one would expect. For example, assume a 6-digit value of 0 is placed into a 10-character field. Then, the original string value would be "000000____" (where _ is a blank). If you invoke the TRMLFTCHR command with TRMCHR('0') and ALLTRMCHR('?'), the return string is "__________", not the expected "?_________". To "fix" this, the CPP would need to be changed to unconditionally scan for an all blank return value and if found, use the appropriate ALLTRMCHR().
While your are tweaking, how about one command that can trim left, trim right, or trim both. Also it would be nice to allow multiple trim characters
And what about those negative numbers ...
Oh well, nice article. Provides a good starting point.
While your are tweaking, how about one command that can trim left, trim right, or trim both. Also it would be nice to allow multiple trim characters
Code:
TRIM VAR(&STR) TRMCHR(' ' '0' '$' ',')
Oh well, nice article. Provides a good starting point.
Comment