As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I'd like to compare 2 string fields on a record and highlight the difference between them if a difference exists. Ideally, I'd display the 2 fields on the row with a 3rd field that shows the string and the offending character formatted with color. Another option would be to indicate the integer position where they diverge so the user could count from the beginning of the string. Identical string lengths with transposed characters are especially tricky to spot the differences.
Any ideas? WebFOCUS, jQuery, or javascript ideas are all welcome.
Thanks,
NorbThis message has been edited. Last edited by: Norb Eckert,
DEFINE FILE CAR
STRING1/A25 WITH COUNTRY = 'a1b2c3d4e5f6g7h8i9j0';
STRING2/A25 WITH COUNTRY = 'alb2c3d4E5f6g7h8i9jO';
DIFF_FLAG/A9 = IF (STRING1 EQ STRING2) THEN 'Same' ELSE 'Different';
STR2_OUT/A120V WITH COUNTRY = '';
-REPEAT :ENDREPEAT1 FOR &I FROM 1 TO 25
STR1_CHAR/A1 = SUBSTR(25,STRING1,&I,&I,1,'A1');
STR2_CHAR/A1 = SUBSTR(25,STRING2,&I,&I,1,'A1');
STR2_OUT = IF (STR1_CHAR EQ STR2_CHAR) THEN (STR2_OUT || STR2_CHAR)
ELSE (STR2_OUT || '<b><font color=red>' || STR2_CHAR || '</font></b>');
-:ENDREPEAT1
END
-*
TABLE FILE CAR
PRINT STRING1 STRING2 STR2_OUT DIFF_FLAG
WHERE RECORDLIMIT EQ 1 ;
END
EDIT: Added the '/' to the closing bold tag, which was missing.This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Just remember that your output field (STR2_OUT in my example) must be large enough to contain all of the extra characters generated by the addition of the bold and font color tags - 30 characters are added to the output string every time there is a difference.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Just wanted to let you know that I added a variant of your code to a fex that runs hourly each day and it worked beautifully to highlight the string differences. The users are squealing with delight! I told them I couldn't have done it without this forum and you.