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 was wondering if you might help me to check if the problem I found is a real WebFOCUS bug (and probably also existing on different versions). I had some issues and discussions with WF support in the past so I would love to show them that my cases are "real bugs" first.
-SET &TEST_STR = 'ABCDEFGHIJKLMNOPQRSTU';
-* tmp variable has been used previously
-SET &TMP = '123';
-* now we use &TMP again for defining the Ax format (could also be done statically: = 'A8')
-SET &LEN = 1;
-SET &TMP = 'A' || &LEN;
-TYPE &TMP
-* do a substr (or any char function using &TMP='Ax'
-TYPE SUBSTR(&TEST_STR.LENGTH, &TEST_STR.QUOTEDSTRING, 2, &LEN + 1, &LEN, '&TMP');
-SET &TEST_STR = SUBSTR(&TEST_STR.LENGTH, &TEST_STR.QUOTEDSTRING, 2, &LEN + 1, &LEN, '&TMP');
-TYPE &TEST_STR.QUOTEDSTRING
Using the a.m. code, I would assume that the resulting &TEST_STR would be 1-char long (as I have assigned -SET &TMP='A1' actually. For my WF version the result is however a string containing a single "B" + 12 spaces - so length=13. What actually happens is: WF is not clearing the previously assigned text in &TMP correctly. Eventhough you cannot see it when -TYPEd - '&TMP' used in SUBSTR seems to contain 'A83'. If you add another figure to -SET &TMP=123, say 4, the '&TMP' will act as 'A134'.
I am using WF 7.7.03 HF6.
Workaround found: using &TMP.QUOTEDSTRING
Could you confirm that this problematic behavour is also valid for your WF version?
Thanks and best regards LinneThis message has been edited. Last edited by: linnex,
Using the .EVAL extension works in 7.7.03, which is how I would have coded it anyway.
-SET &TEST_STR = 'ABCDEFGHIJKLMNOPQRSTU';
-* tmp variable has been used previously
-SET &TMP = '123';
-* now we use &TMP again for defining the Ax format (could also be done statically: = 'A8')
-SET &LEN = 1;
-SET &TMP = 'A' || &LEN;
-TYPE &TMP
-* do a substr (or any char function using &TMP='Ax'
-TYPE SUBSTR(&TEST_STR.LENGTH, &TEST_STR.QUOTEDSTRING, 2, &LEN + 1, &LEN, '&TMP.EVAL');
-SET &TEST_STR = SUBSTR(&TEST_STR.LENGTH, &TEST_STR.QUOTEDSTRING, 2, &LEN + 1, &LEN, '&TMP.EVAL');
-TYPE &TEST_STR.QUOTEDSTRING
-SET &TEST_STR = 'ABCDEFGHIJKLMNOPQRSTU';
-* tmp variable has been used previously
-SET &TMP = '123';
-* now we use &TMP again for defining the Ax format (could also be done statically: = 'A8')
-SET &LEN = 1;
-SET &TMP = 'A' || 1;
-TYPE A1
A1
-* do a substr (or any char function using &TMP='Ax'
-TYPE SUBSTR(21, 'ABCDEFGHIJKLMNOPQRSTU', 2, 1 + 1, 1, 'A1');
SUBSTR(21, 'ABCDEFGHIJKLMNOPQRSTU', 2, 1 + 1, 1, 'A1');
-SET &TEST_STR = SUBSTR(21, 'ABCDEFGHIJKLMNOPQRSTU', 2, 1 + 1, 1, 'A1');
-TYPE 'B'
'B'
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
When amper variable substitution is performed on Focus commands (i.e., fex lines without a leading "-"), it is done by a process that is essentially innocent of any knowledge of Focus-command syntax, and the substitution is mechanical.
But within a dialog manager directive, substitution is generally not performed in scanning the line, absent an explicit .EVAL.
For example,
-DEFAULT &FOO = &BAR ;
results in the four-character string "&BAR" (rather than the current value of the variable named &BAR) becoming the value of &FOO.
Even in
-SET &FOO = &BAR ;
the lookup of the value of &BAR occurs in the execution stage, not in the parsing stage. If &BAR contains 1+2, it will set &FOO to '1+2', not 3.
If substitution is performed at all on the final arg "'&TMP'" in linnex's -SET, I believe it's an undocumented feature. Don't rely on such favors -- play it safe and control the process by using &var.QUOTEDSTRING or '&var.EVAL'.
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
thanks, Tony, for the suggestions using .EVAL and Jack for your explanation on the substition mechanisms.
I have now been working with WF for > 3 years and I have never seen a similar (programming) language before where you have so many "undocumented features" on which you should not rely etc. With WF it is really difficult to decide which one is a real feature (and will hopefully never be changed with a new version - which I have already experienced as well) and which is just "there" be coincidence...
FOCUS is really not one of my favorite computer languages and those "features" will not increase my liking of it