July 14, 2008, 01:47 PM
j.grossThat will remove all instances.
To delete just the final non-blank character you can use ARGLEN (to determine its position) and SUBSTR.
July 14, 2008, 02:02 PM
Gobinath VelusamyHi
I cant determine the length ... i t will vary dynamically
July 14, 2008, 02:19 PM
j.grossAre these dialog manager & variables, or Focus fields? If the latter, are they fixed or variable in length?
July 14, 2008, 02:27 PM
GinnyJakesThere is a REVERSE subroutine. You can flip the contents, check to see if the firt character is a comma, remove it, then flip it back.
July 14, 2008, 02:31 PM
krishkasiHi Gopinath,
Can you try this below?
-SET &TEST = 'All,1,2,3,';
-SET &TEST1 = SUBSTR(&TEST.LENGTH, &TEST, 1, &TEST.LENGTH-1, &TEST.LENGTH-1, 'A&TEST.LENGTH');
-TYPE &TEST1
July 15, 2008, 04:05 AM
Danny-SRLGobinath,
I think you can use TRIM:
-* File strip1.fex
-SET &ST='A1,A2,A34,';
-SET &STL=&ST.LENGTH;
-SET &STM=TRIM('T','&ST.EVAL',&STL,',',1,'A&STL.EVAL');
-TYPE &ST : &STM
However, if the ',' is not the last character in your string and you have trailing blanks, then you should also r-justify your string:
-SET &ST='A1,A22,A3425, ';
-SET &STL=&ST.LENGTH;
-SET &STM=LJUST(&STL, TRIM('T',RJUST(&STL,'&ST.EVAL','A&STL.EVAL'),&STL,',',1,'A&STL.EVAL'),'A&STL.EVAL');
-TYPE &ST : &STM
This message has been edited. Last edited by: Danny-SRL,