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     [CLOSED] Fakearray/Loop incompatabilities between 7.6.4 and 7.6.9

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Fakearray/Loop incompatabilities between 7.6.4 and 7.6.9
 Login/Join
 
Member
posted
Someone may find this interesting or (with any luck) have similar requirements and have already found the answer to my question. So this is a case I just submitted.
--8<--
We have just upgraded our development server from 7.6.4 to 7.6.9. Since that time very few of the many reports on that system ran correctly. All of them autoprompted for ampers that were never an issue before.

I have investigated and I believe I have identified the source of the problem. We make extensive use of -INCLUDE files. In many cases the files to be included are included via a loop iterating over a fakearray like so:

-* This bit is set up prior to the include.
-SET &INCLUDEFILES0=3;
-SET &INCLUDEFILES1='firstincfile';
-SET &INCLUDEFILES2='secondincfile';
-SET &INCLUDEFILES3='thirdincfile';
-*
-* this next bit is -MRNOEDIT -INCLUDED as part of a larger file.
-***********************************************
-* Loop through and include required files.
-***********************************************
-REPEAT INCLOOPEND FOR &INCLOOP FROM 1 TO &INCLUDEFILES0;
-TYPE -MRNOEDIT -INCLUDE include_files/&INCLUDEFILES&INCLOOP.EVAL.EVAL.fex
-INCLOOPEND

If the above code is run in isolation it behaves as follows:
On 7.6.9 it autoprompts for INCLOOP INCLUDEFILES0; and INCLUDEFILES
On 7.6.4 it autoprompts for INCLUDEFILES

However the big difference comes from its behavior when this code itself is executed as part of an -INCLUDE. On 7.6.4 it appears that the "error" of unresolved ampers is reported but ignored. Execution continues unaffected. On 7.6.9 it throws up an autoprompt.
So it appears that there are a few things with that snippet that were problematical but invisible to us on 7.6.4. I removed the redundant .EVAL (which was not affecting execution), the ampersand on the INCLOOP variable and the trailing semicolon on the -REPEAT statement. That just left me with the prompt for INCLUDEFILES. Of course on 7.6.9 this is still enough to throw up the autoprompt page. To get rid of that I tried various things to no avail.

Then out of frustration I -SET INCLUDEFILES =''; and (tada) it worked! Well "worked" as in no longer prompted me. I would rather not have to skirt around the problem like this so I really need to know the correct "future-proof" way of accomplishing this type of fakearray/loop. When it is time to install 7.7.x I do not want to spend hours jumping through hoops because more "code tightening" means I have to adhere to syntax that is so obscure it might as well be written in sanskrit Smiler

So please let us know how this is supposed to be done!

While looking for a solution I foud the following behavior that may interest you and may shed some light on my issue. Even if it doesn't is does seem rather odd and bears an explanation.


-*Works on 7.6.4
-* Prompts for FAKEARRAY0 on 7.6.9

-SET FAKEARRAY0=3;
-REPEAT ALOOP FOR ARRAYLOOP FROM 1 TO &FAKEARRAY0
-SET &FAKEARRAY.&ARRAYLOOP = '[ &ARRAYLOOP.EVAL ]';
-ALOOP

-REPEAT BLOOP FOR ARRAYLOOP2 FROM 1 TO &FAKEARRAY0
-TYPE &FAKEARRAY.&ARRAYLOOP2
-BLOOP

-* When you look at the amper dump you'll see FAKEARRAY0 is set to 3 regardless of what you entered in autoprompt.
-* Obviously it's attempting to resolve it prior to the -SET.

-? &
-EXIT
-***************************************************************************************
-***************************************************************************************
-***************************************************************************************


-* Works on 7.6.9
-* Autoprompts for FAKEARRAY on 7.6.4

-SET &FAKEARRAY0=3;
-SET &FAKEARRAY1='[ A ]';
-SET &FAKEARRAY2='[ B ]';
-SET &FAKEARRAY3='[ C ]';

-REPEAT CLOOP FOR ARRAYLOOP FROM 1 TO &FAKEARRAY0
-TYPE &FAKEARRAY.&ARRAYLOOP
-CLOOP

-* When you look at the amper dump you'll see FAKEARRAY is set to whatever you entered in autoprompt

-? &
-EXIT

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






Live and Direct from the University of Virginia.


DevStudio 7.6.9 - WF-7.6.9 - Win2k3 - MRE - RC - MSSQL - XBOX-360 Elite - Playstation 3 - Wii - PSP - Nintendo DSi - iPod Touch - Suzuki B-King - Honda Valkyrie - Subaru WRX STI - Canon EOS 1D Mark IV - Lover of Toys.
 
Posts: 21 | Location: Virginia | Registered: May 10, 2005Report This Post
Expert
posted Hide Post
I think that the "autoprompted for ampers that were never an issue before" is due to an admin setting... Check out "Parameter Prompting" / "IBIF_wfdescribe" in the "WebFOCUS Admin Console"... There's probably other stuff that got configured differently in the upgrade.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
<JG>
posted
I would tend to agree with Doug,
It sounds like you have just forgotten to migrate your configuration.

When you go into the WF Administration Console for the first time it should ask if
you want to migrate, if you did an upgrade and not a clean install.
 
Report This Post
Member
posted Hide Post
Thanks guys, I understand what you mean. However we always have the autoprompt feature turned on. It's just that before the upgrade our code wasn't causing any unresloved amper problems, and afterwards it did. Once I fixed the -REPEAT loop syntax, some of the ampers prompted for went away, but I still needed to set a dummy unused amper because the preprocessor gets confused by derived amper var names. I think I understand why it's doing what it's doing. It just seems pretty dumb behavior that's all. Much as I'm hoping to avoid more problems of this type at the next upgrade, I think I'll just have to deal with the problems as they crop up *sigh*






Live and Direct from the University of Virginia.


DevStudio 7.6.9 - WF-7.6.9 - Win2k3 - MRE - RC - MSSQL - XBOX-360 Elite - Playstation 3 - Wii - PSP - Nintendo DSi - iPod Touch - Suzuki B-King - Honda Valkyrie - Subaru WRX STI - Canon EOS 1D Mark IV - Lover of Toys.
 
Posts: 21 | Location: Virginia | Registered: May 10, 2005Report This Post
Virtuoso
posted Hide Post
I don't see why you need .EVAL at all. I would use -SET to construct the fileid, using the standard dot notation for "indexed" variables, and reference the resuting &var in the -include:
-SET &INCLUDEFILES0=3;
-SET &INCLUDEFILES1='firstincfile';
-SET &INCLUDEFILES2='secondincfile';
-SET &INCLUDEFILES3='thirdincfile';
-***********************************************
-REPEAT INCLOOPEND FOR &INCLOOP FROM 1 TO &INCLUDEFILES0;
-SET &fex = 'include_files/' | &INCLUDEFILES.&INCLOOP | '.fex';
-MRNOEDIT -INCLUDE &fex
-INCLOOPEND


You only need -MRNOEDIT in order to escape the -INCLUDE (so that it becomes a server-side include rather than an MR include). The -SET shouldn't require it.

The reference to &fex will be expanded by dialog manager when
-INCLUDE &fex

will be parsed on the server; .EVAL should not be needed.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
J, I use the ".EVAL" whenever I want to ensure that the variable is EVALuated before the statement is interpreted. I was told that this was one of the "Best Practices" where you can never go wrong doing it this way. "A little .EVAL never hurts anything"...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
Whoever sold you that aphorism owes you a refend. .EVAL is a transformation, and there are times when adding it will change your result. Get to know the mechanics of what it does, and you'll know when it is called for.

Getting back to your code, and what changed with the releases:

&INCLUDEFILES&INCLOOP.EVAL.EVAL.fex

Dialog manager scans the line right to left left to right [my head was still on vacation is Israel], locating amper var references and performing substitution.

Under the old release, apparently the interpretation of &INCLUDEFILES, when immediately followed by an &, is left pending. If &INCLOOP is 1, the application of the first .EVAL changes
&INCLUDEFILES&INCLOOP.EVAL.EVAL.fex
to
&INCLUDEFILES1.EVAL.fex
and the remaining .EVAL is applied to
&INCLUDEFILES1
resulting in
firstincfile.fex


Under the newer release, once the rightward scan encounters the & (of &INCLOOP) immediately following &INCLUDEFILES, &INCLUDEFILES is recognized as an amper variable reference and its fate is sealed (substitution if it's defined; error or autoprompt otherwise).

I don't think the old behavior was documented, so I would avoid going there -- especially when the dot construct (&stemvariable.&indexvariable ) is provided (search on "indexed variables") precisely to provide a means of referencing indexed variables.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Thanks for the clarification Jack. Allow me to elaborate on my "whenever I want" statement with a clarification of the fact that I do stringent testing and verification before I accept the final results of my coding. That is "whenever I want" NE "ALWAYS" -Doug
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report 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     [CLOSED] Fakearray/Loop incompatabilities between 7.6.4 and 7.6.9

Copyright © 1996-2020 Information Builders