On Mon, Mar 9, 2020 at 4:46 PM John J Foster via 4D_Tech < 4d_tech@lists.4d.com> wrote:
> Hi Olivier, > > I think I’m so use to thinking of a process, aka CALL WORKER, as being > independent. The variables are of the process. So in this case that would > have to mean that the listbox and arrays are seen and updated in both the > form and the process. > > Is that right? > In fact, worker cannot share variables with another process (think of worker as another process running on another processor, not sharing the memory with main process.) But worker can call a method with CALL FORM and pass a parameters to that call, and the parameter can be, for example, an object with embedded values. Peter Bozek > > John... > > > > Try to see CALL FORM as "execute this project method in the context of > this form", similar to EXECUTE METHOD IN SUBFORM > > > > So, the method you execute should update/fill the listbox. > > > > e.g. CALL FORM ($WinRef;"MyListboxUpdateMethod";$ObjectWithData) > > > > Best, > > > > Olivier > > > >> On Mar 9, 2020, at 6:33 AM, John J Foster <trueg...@isomedia.com> > wrote: > >> > >> Hi Jeremy, > >> > >> OK, conceptually then: > >> > >> LB Form (array based - 5-8 arrays) -> Search button spawns CALL WORKER > >> > >> So then CALL WORKER searches and as it finds a match it returns them > via CALL FORM (perhaps in an object) and then the listbox rows are > processed… > >> > >> So the question is - since CALL FORM doesn’t seem to cause an event and > since the search data found and returned is from another process - how does > the Listbox “know” to build (append to array) itself or add to itself as > data arrives? How is the Listbox updated? > >> > >> Reviewed the few examples in the KB and HDI and I’m not seeing what I > need to do. Probably too simple and I’m thinking more complicated. > >> > >> Any further code fragment or small examples? > >> > >> Appreciate the feedback, > >> John… > >> > >> > >>> > >>> Have a look at CALL WORKER and CALL FORM. > >>> > >>> Start the data build in a new process using CALL WORKER. > >>> Have the worker process prod the form into updating the listbox from > time time using CALL FORM. > >>> > >>> I’ve implemented something much more trivial and it works nicely. > >>> > >>> Jeremy > >>> > >>>> 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 > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ********************************************************************** -- -- 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:4d_tech-unsubscr...@lists.4d.com **********************************************************************