Focal Point
About Trim spaces

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/378106692

November 18, 2009, 10:59 PM
Yangyang
About Trim spaces
the code:

-SET &YY = 'TEST ';
-SET &YYTEST= TRIM('B', '&YY.EVAL', &YY.LENGTH, ' ', 1, 'A&YY.LENGTH');

the result :

-TYPE &YYTEST ;

aslo displays: 'TEST '


how to trim the trailing spaces ?



Thanks,
Yang


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
November 18, 2009, 11:40 PM
Waz
Using the logic you have this will work.
-SET &YY = 'TEST ';
-SET &YYLEN = ARGLEN(&YY.LENGTH,&YY,'I2') ;
-SET &YYTEST= TRIM('T',&YY, &YY.LENGTH, ' ', 1, 'A&YYLEN.EVAL');
-TYPE '&YY';
-TYPE '&YYTEST';


But I would use
-SET &YYTEST = TRUNCATE(&YY);



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

November 19, 2009, 12:17 AM
Yangyang
Thanks Waz.

it's fixed.

Thank you very much!


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET