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     [SOLVED] Stack Index is less than or equal to zero in Maintain

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Stack Index is less than or equal to zero in Maintain
 Login/Join
 
Gold member
posted
Hi everyone,

I was wondering if anyone could tell me why this function returns with the error message,
"Stack Index is less than or equal to zero"
The code is

Case AddEF
For all next emergency_funds.EMERGENCY_FUNDS.EFID into GetEmergFundStack ;
Compute EmergFundStack.EFID = GetEmergFundStack(GetEmergFundStack.Foccount).EFID + 1;
Stack clear GetEmergFundStack ;
For all include emergency_funds.EMERGENCY_FUNDS.EFID from EmergFundStack ;
Stack clear EmergFundStack ;
EndCase

This function is supposed to run when a user clicks the submit button. It works when they submit the first
record, but if they enter a new information into the form and hit submit again I receive this error. Any insight would be greatly appreciated.

Thanks

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


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report This Post
Virtuoso
posted Hide Post
At first guess I cannot see why this would happen. My belief is that GetEmergFundStack.FocCount has to be a minimum of 1, but maybe for some reason it is zero. You can check by TYPEing it out.

(Just a thought, are you doing a reposition on emergency_funds.EMERGENCY_FUNDS.EFID, if it works on first but not on second, this could be the cause.)

That would be the only place I see this message being generated from your code slice though.

As a matter of course, I find that EXECing a fex to get the MAX.number (EFID) is quicker and easier than doing a For all next, which has to retrieve all records.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
Please add:

REPOSTION emergency_funds.EMERGENCY_FUNDS.EFID

To the top of your AddEF case. The first time through this case, there are records. The second time through this case, the database pointer is at the end of the file. When you go to reload, no records are loaded, GetEmergFundStack.Foccount = 0 and that's why you are getting the error.

In the future, if there are no records in the database you can do a check:

if GetEmergFundStack.Foccount = 0 then compute GetEmergFundStack.EFID = 1;

Alan points out that you could EXEC a table to get the maximum EFID, you can also make the segment an SH format. This way, you only have to read the first record instead of all the records.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
Thanks for the help. It worked when I added REPOSITION to the code, but it was quicker to EXEC a fex to find the maximum EFID. So both of your solutions worked great and I really appreciate both of you chiming in.


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report 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     [SOLVED] Stack Index is less than or equal to zero in Maintain

Copyright © 1996-2020 Information Builders