i have this problem:
I have two string:
Name a(35) (this string can cointains one or more word. If cointains more word I must to insert '_' between the word )
I must write only string.
Name = MARIA ROSA
Surname = ROSSI
NEW_STRING = MARIA_ROSA ROSSI
Thanks for any help!!This message has been edited. Last edited by: Kerry,
You haven't filled in your signature with the version that you are running so I don't know if this function is available to you - one reason why you should fill in your signature!
Use STRREP, if it's available to you, on the Name string and then hard concatenate (||) the result to the result of a soft concatenation (|) of a space and the surname-
NEW_STRING/A71 = STRREP(............) || (' ' | Surname);
Use search (top right) to locate previous posts on STRREP or use the help files in Dev Studio.
I don't know the STRREP function.
I use FOCUS 7.2.0.
Can you help me?
Click "Search the Technical Documentation Library" link in the top right hand area of this page and then in the right hand pair of form inputs choose "FOCUS/WebFOCUS Messages" and then type STRREP in the lower text box. Click GO to get a result set from your search. I'd suggest the fourth item in the list as being the best for your understanding.
for handling the first name,
APP PATH ibisamp DEFINE FILE EMPLOYEE LENGTH/I2=ARGLEN(25,JOB_DESC,LENGTH); NEWJD/A25=STRREP(25,JOB_DESC,1,' ',1,'_',25,NEWJD); JOB_DESC_OUT/A25=SUBSTR(25,NEWJD,1, LENGTH, LENGTH, JOB_DESC_OUT); END TABLE FILE EMPLOYEE BY JOB_DESC BY LENGTH BY NEWJD BY JOB_DESC_OUT END
i've had ageda with using just the STRREP function , as it will replace all the trailing blanks as well,
so my workaround is to
1) find the actual length of the name using the ARGLEN function
2) do the replace
3) then trim the result back to the beginning length, using the SUBSTRing function.
Now you're ready to concat the LAST_NAME; Proceed as T has demonstrated for you.
As T suggests, the manual 'USING FUNCTIONS' is one of the 4 core manuals, and its priceless in value. Focus has text editing functions that are sine qua non.
You might also look into using the GETTOK option. Note when building strings with concatenation, the length of the target string must be defined of a length at least as long as the sum of the two originating strings.
|Powered by Social Strata|