%TRIMR built-in function returns the given string less any trailing blanks.
%TRIMR (String)
Required. Can be character, graphic, or UCS-2 data. When specified as a parameter for a definition specification keyword, the string parameter must be a constant.
BEGSR CommandButton7 Click
DclConst Name(String) Value("This is a test string. ")
ioField1.Text = %TrimR (String)
ENDSR