Hi Peter,

I haven’t used CALL WORKED/CALL FORM yet. I’ve seen some tutorials by John 
Baughman which made sense when I watched them. But a different context I think.

I guess that’s why my brain is not seeing this clearly yet.

My search form has a bunch of variables including a date range, a source and 
target arrays that it needs to loop through and a mother array list. The search 
will go something like:

Loop through Source array
for this Source{index}...
   Loop through Target array
   for this Target{index}...
      Loop through Aspect array
      for this Aspect{index}…
         Call this search method for tis date range…
         As rows are found build the listbox

> 1. 4D would be quite straightforward: process that display LB wold initialise 
> empty arrays and will launch process or worker that calculates values. 

1. So when the form is loaded then the CALL WORKER is launched and remembered 
for later use.

2. Worker then calls CALL FORM periodically with values - per line or group of 
lines ??? 

3. Called method inserts calculated values into displayed arrays???

How does it do this using the above scenario? Pseudo code?

John…



> We did something similar with colleague, some time ago, not in 4D, but idea 
> would be similar:
> 
> 1. we initialised arrays to proper size (amount of data was know beforehand). 
> At that moment, user would see an area with empty lines
> 2. we run a process that calculated the lines and updated arrays and area. 
> 3. as a optimisation, we did not calculated all lines, only a small part 
> (256?) so the area would display something immediately. When the user 
> scrolled down, process started to calculate lines from scroll position. 
> 
> Implementing it in 4D would be quite straightforward: process that display LB 
> wold initialise empty arrays and will launch process or worker that 
> calculates values. Worker then calls CALL FORM periodically with values - per 
> line or group of lines -  and called method inserts calculated values into 
> displayed arrays. 4D would handle the update of LB, process with LB would not 
> be frozen and user would be able to see how are the values filling the area.
> 
> Using workers would allow implementation of point 3. quite straightforward, 
> but it may not be necessary. As a first  step, I would let worker calculate 
> all lines. Only if calculation takes too long (minutes) I would try to adjust 
> worker call so it calculates only displayed lines.
> 
> HTH,
> 
> Peter Bozek
> 
> 
> On Sun, Mar 8, 2020 at 7:38 PM John J Foster via 4D_Tech 
> <[email protected] <mailto:[email protected]>> wrote:
> Hi All,
> 
> 4D v17 R5 (Mac and Windows single user standalone)
> 
> I have a list box that needs to be built and available before the calculation 
> is complete. In this case I have some searches looking for particular 
> conditions and when found add them to the listbox. They could easily take a 
> few seconds to I’m guessing a  minute or more. The searching could span 50-60 
> sub searches within a 100 years of daily data (Think daily stock market data 
> but it’s not for the stock market).
> 
> So I would like a strategy:
> 
> - so that list box remains available as it’s being built.
> 
> - the screen is not frozen as it’s being built.
> 
> - The list box fills as each row is found/added and can be seen rebuilding. 
> 
> I’ve seen this kind of thing in a windows app (not 4D) and I’d like to 
> emulate the behavior.
> 
> I need a strategy I’m guessing that involves another process which knows how 
> to communicate back to this form/listbox. Is this where workers could be 
> helpful?
> 
> Does anyone have some snippets of code I could see to visualize the process?
> 
> Appreciate,
> John…
> 
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html 
> <http://lists.4d.com/archives.html>
> Options: https://lists.4d.com/mailman/options/4d_tech 
> <https://lists.4d.com/mailman/options/4d_tech>
> Unsub:  mailto:[email protected] 
> <mailto:[email protected]>
> **********************************************************************
> 
> 
> -- 
> --
> 
> Peter Bozek

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to