Focal Point
query regarding REPEAT keyword

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2837062236

July 16, 2013, 07:58 PM
sonali
query regarding REPEAT keyword
I have a focus file with 80K records. Existing functionality is - Online screen updates the data in file and REPEAT command is used to search existing record in the file. This functionality works for few scenarios and failed for few.
When i check the count (number of times) entered values is compared with key field in file , count is always 65K in both cases .

When i deleted some records from file and then run this functionality, it works as expected.

My query is - does this repeat command has any limitation on loop count


focus version 7.2.3, mainframe
excel
July 16, 2013, 10:55 PM
Vivian
Interesting...I had that problem years ago -- I had to do a repeat loop and whenever it went to about 125 times, it would crash.

So, I ended up breaking up the loop and actually exiting Focus and re-entering after writing out the last instance and then starting from there.

Looks like that limitation may still exist.

Vivian


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

July 16, 2013, 11:23 PM
j.gross
In Modify, I encountered a 64K limit on "REPEAT n [TIMES]". That's a while back, but Modify is "stabilized" so it's presumably still true.

Try converting it to REPEAT WHILE.


- Jack Gross
WF through 8.1.05
July 17, 2013, 01:07 AM
Danny-SRL
Sonali,

In the very far back past when -REPEAT did not exist, we used to simulate a loop with -IF and -GOTO.
I suggest you try this.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

July 17, 2013, 10:16 AM
Francis Mariani
More importantly, what's in the -REPEAT loop?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
July 17, 2013, 12:30 PM
sonali
thanks all for your response.

Below is code

Modify file
some processing

Reposition keyfield
Repeat * times
next key fields
on next ( tries to find the required record in file and if found , it hold the segment)
ON NEXT HOLD SEG.(key field)
end repeat
Later segment is deleted and new one is added with correct value.


focus version 7.2.3, mainframe
excel
July 17, 2013, 02:13 PM
David Briars
I used to work with MODIFY, and miss it!

It sounds like you are NEXTing through a segment, with a very large number of occurrences.

You might want to clarify if you are saving multiple records (SPA), or if you are saving only one record.

Is it possible to establish a position in the segement with MATCH, and then start NEXTing at that point?

Does your code stop NEXTing, when it stops finding records it needs?
July 17, 2013, 04:15 PM
j.gross
If it's feasible, it will be simpler to (first use TABLE to) HOLD the keys + other pertinent data for the records that need revision/deletion, and use
FIXFORM FROM HOLD
(rather than a Next loop )
to drive the operation.


- Jack Gross
WF through 8.1.05
July 17, 2013, 04:43 PM
David Briars
quote:
HOLD the keys + other pertinent data for the records that need revision/deletion, and use FIXFORM FROM HOLD

Exactly where I was going with this line of questioning! :-)

This message has been edited. Last edited by: David Briars,
July 17, 2013, 05:02 PM
sonali
Thanks. I will try this option. I have never made any changes to focus online program so not sure if this option will work.

My code do not have define file or table file and i am beginner in online focus. I will keep you updated with progress or new issues Smiler

Thanks everyone for reply and valuable information.


focus version 7.2.3, mainframe
excel
July 17, 2013, 05:21 PM
Doug
Ahhh, The good ol' days...
quote:
I used to work with MODIFY, and miss it!