Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CASE-OPENED] Bug in WF handling &VARs for output formats

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CASE-OPENED] Bug in WF handling &VARs for output formats
 Login/Join
 
Gold member
posted
Dear all,

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
Linne

This message has been edited. Last edited by: linnex,


WebFOCUS 7.7.03
 
Posts: 67 | Registered: January 05, 2011Report This Post
Gold member
posted Hide Post
works fine in Verions 7.6.5:
-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'


WebFOCUS 7.6, 7.7
Windows, All Output formats
 
Posts: 90 | Location: Stuttgart | Registered: October 20, 2010Report This Post
Gold member
posted Hide Post
Thanks Michael for checking.

Seems that they have introduced this "new behaviour" in 7.7.? Wink


WebFOCUS 7.7.03
 
Posts: 67 | Registered: January 05, 2011Report This Post
Expert
posted Hide Post
Works in 7.1.6, 7.6.6, 7.6.12 and 8.0.02M, but does not in 7.7.03


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Hi Waz,
thanks for testing it in multiple versions.
This is greatly appreciated.

Cheers Linne


WebFOCUS 7.7.03
 
Posts: 67 | Registered: January 05, 2011Report This Post
Gold member
posted Hide Post
Have opened a mior case. Just in case the problem is not yet known and "remains" in the 7.7.0+ line.

Thanks again to Michael and Waz for your tests.


WebFOCUS 7.7.03
 
Posts: 67 | Registered: January 05, 2011Report This Post
Expert
posted Hide Post
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, 2004Report This Post
Virtuoso
posted Hide Post
Let me add to Tony's remarks.

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, 2005Report This Post
Gold member
posted Hide Post
Hi,

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 Wink

Well, for me it'll always be Hocus Pocus Focus


WebFOCUS 7.7.03
 
Posts: 67 | Registered: January 05, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CASE-OPENED] Bug in WF handling &VARs for output formats

Copyright © 1996-2020 Information Builders