Re: [Gambas-user] gbx3: warning: 4 allocation(s) non freed

2016-10-09 Thread PICCORO McKAY Lenz
hi benoit i see the same message in my gambas since 3.8, in previous 3.4 i
do not see,

i always use the 3.4 gambas due i dont like the modernis but sqlite
componet have lot of bugs before 3.7 so i update to 3.8 and now using 3.9
have same messages

specially when we have multiple forms that popups others

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2016-10-06 11:14 GMT-04:00 Benoît Minisini :

> I don't have the time now to make a VM and compile and install all the
> needed stuff in it.
>
> So: can you send me the output of the 'i-nex-cpuid' command on one of
> your system?
>
> And do you have the final warning message all the time?
>
> Le 06/10/2016 à 16:56, shirish शिरीष a écrit :
> > addition at bottom :-
> >
> > On 06/10/2016, shirish शिरीष  wrote:
> >> Hi all,
> >>
> >> I/We have been compiling a cpu-z like tool called I-Nex and came
> >> across the warning above.
> >>
> >> See https://github.com/i-nex/I-Nex
> >>
> >> The issue can be seen at https://github.com/i-nex/I-Nex/issues/7
> >>
> >> Somebody also tried compiling with gambas 3.9.1 but still the issue
> >> persists.
> >>
> >> Can somebody look/guide us where the issue could be ?
> >>
> >> I am on Debian testing and these versions are in my system -
> >>
> >> ┌─[shirish@debian] - [~] - [10171]
> >> └─[$] apt-cache policy gambas3-gb-desktop-x11 gambas3-gb-desktop
> >> gambas3-gb-form-stock gambas3-gb-form gambas3-gb-qt4 gambas3-gb-image
> >> gambas3-runtime
> >>
> >> gambas3-gb-desktop-x11:
> >>   Installed: 3.8.4-6+b1
> >>   Candidate: 3.8.4-6+b1
> >>   Version table:
> >>  *** 3.8.4-6+b1 600
> >> 600 http://httpredir.debian.org/debian testing/main amd64
> Packages
> >>   1 http://httpredir.debian.org/debian unstable/main amd64
> Packages
> >> 100 /var/lib/dpkg/status
> >> gambas3-gb-desktop:
> >>   Installed: 3.8.4-6+b1
> >>   Candidate: 3.8.4-6+b1
> >>   Version table:
> >>  *** 3.8.4-6+b1 600
> >> 600 http://httpredir.debian.org/debian testing/main amd64
> Packages
> >>   1 http://httpredir.debian.org/debian unstable/main amd64
> Packages
> >> 100 /var/lib/dpkg/status
> >> gambas3-gb-form-stock:
> >>   Installed: 3.8.4-6
> >>   Candidate: 3.8.4-6
> >>   Version table:
> >>  *** 3.8.4-6 600
> >> 600 http://httpredir.debian.org/debian testing/main amd64
> Packages
> >>   1 http://httpredir.debian.org/debian unstable/main amd64
> Packages
> >> 100 /var/lib/dpkg/status
> >> gambas3-gb-form:
> >>   Installed: 3.8.4-6
> >>   Candidate: 3.8.4-6
> >>   Version table:
> >>  *** 3.8.4-6 600
> >> 600 http://httpredir.debian.org/debian testing/main amd64
> Packages
> >>   1 http://httpredir.debian.org/debian unstable/main amd64
> Packages
> >> 100 /var/lib/dpkg/status
> >> gambas3-gb-qt4:
> >>   Installed: 3.8.4-6+b1
> >>   Candidate: 3.8.4-6+b1
> >>   Version table:
> >>  *** 3.8.4-6+b1 600
> >> 600 http://httpredir.debian.org/debian testing/main amd64
> Packages
> >>   1 http://httpredir.debian.org/debian unstable/main amd64
> Packages
> >> 100 /var/lib/dpkg/status
> >> gambas3-gb-image:
> >>   Installed: 3.8.4-6+b1
> >>   Candidate: 3.8.4-6+b1
> >>   Version table:
> >>  *** 3.8.4-6+b1 600
> >> 600 http://httpredir.debian.org/debian testing/main amd64
> Packages
> >>   1 http://httpredir.debian.org/debian unstable/main amd64
> Packages
> >> 100 /var/lib/dpkg/status
> >> gambas3-runtime:
> >>   Installed: 3.8.4-6+b1
> >>   Candidate: 3.8.4-6+b1
> >>   Version table:
> >>  *** 3.8.4-6+b1 600
> >> 600 http://httpredir.debian.org/debian testing/main amd64
> Packages
> >>   1 http://httpredir.debian.org/debian unstable/main amd64
> Packages
> >> 100 /var/lib/dpkg/status
> >>
> >> Basically all are at 3.8.4-6+b1 but as seen in the bug/ticket somebody
> >> also tried doing the same with 3.9.1
> >>
> >> Looking forward to some tips/resolution.
> >>
> >
> > Here are the details you need and please CC me as I have turned off
> > mails as am info. overloaded . I have edited some details in the info.
> > you need for security reasons, hope that is understandable. All the
> > ones with x's are the ones I edited.
> >
> > [System]
> > Gambas=3.8.4
> > OperatingSystem=Linux
> > Kernel=4.7.0-1-amd64
> > Architecture=x86_64
> > Distribution= stretch/sid
> > Desktop=MATE
> > Theme=Gtk
> > Language=en_US.UTF-8
> > Memory=1995M
> >
> > [Libraries]
> > Cairo=libcairo.so.2.11400.6
> > Curl=libcurl.so.4.4.0
> > DBus=libdbus-1.so.3.14.7
> > GStreamer=libgstreamer-1.0.so.0.803.0
> > GTK+2=libgtk-x11-2.0.so.0.2400.31
> > GTK+3=libgtk-3.so.0.2200.1
> > OpenGL=libGL.so.1.2.0
> > Poppler=libpoppler.so.61.0.0
> > QT4=libQtCore.so.4.8.7
> > QT5=libQt5Core.so.5.6.1
> > SDL=libSDL-1.2.so.0.11.4
> >
> > [Environment]
> > CLUTTER_BACKEND=x11
> > DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> > DESKTOP_AUTOSTART_ID=x
> > 

Re: [Gambas-user] App idle with long loops

2016-10-09 Thread Jorge Carrión
Thanks to every one for the information. I think I have enough to make my
proyect more usable.

Best Regards



2016-10-09 18:40 GMT+02:00 Tobias Boege :

> On Sun, 09 Oct 2016, Jorge Carrión wrote:
> > 2016-10-08 23:54 GMT+02:00 Demosthenes Koptsis :
> >
> > > On 8/10/2016 19:09 μμ, Tobias Boege wrote:
> > > > On Sat, 08 Oct 2016, Demosthenes Koptsis wrote:
> > > >> Hello,
> > > >>
> > > >> i have very long (time consuming) For loops and my app is frozen
> until
> > > >> loop is finished.
> > > >>
> > > >> for example i wget urls with a custom Sub which
> Shell("wgetURLS.sh") To
> > > >> sOUTPUT
> > > >>
> > > >> 'get urls
> > > >> For i = 0 To iDepth
> > > >>   wgetURLS(i * 10)
> > > >> Next
> > > >>
> > > >> Public Sub wgetURLS(iStart As Integer)
> > > >> .
> > > >>
> > > >> Shell("wgetURLS.sh") To sOUTPUT
> > > >>
> > > >> .
> > > >>
> > > >> --
> > > >>
> > > >> Is there possible to set the gui idle and the same time run
> For...loops?
> > > >>
> > > > If you only want to refresh the GUI (e.g. if your For loops update a
> > > > ProgressBar on your form and you want to update the value of that bar
> > > > during the loop), then Wait [1] is sufficient.
> > > >
> > > > If you want the GUI to be fully operatable while your loops run in
> the
> > > > background, you have to use a background Task [2]. As Gambas is
> single-
> > > > threaded, Tasks are implemented as external processes which execute
> one
> > > > of your classes. This limits the things you can do with Tasks (you
> cannot
> > > > directly modify the main program, for example, but have to send data
> and
> > > > status reports through a pipe from your Task to the main process and
> > > > interpret them there). However, if all you want is loading some
> files via
> > > > wget, that should not be a problem.
> > > >
> > > > Of course, there is also the gb.net.curl component which can download
> > > files
> > > > asynchronously. If you can use that (which depends on what you want
> to
> > > do),
> > > > you should.
> > > >
> > > > And as a fourth option, looking further into your code: if you want
> to
> > > > execute shell scripts in a For loop, then don't use the Shell-To
> syntax
> > > > but create a Process object instead and accumulate its output in Read
> > > > events. The event loop will take care of everything and the GUI will
> be
> > > > usable without any extra effort on your side.
> > > >
> > > > Finding the best solution depends, who would have thought, on what
> you
> > > want
> > > > to do *specifically*. Tasks are the most general and most cumbersome
> > > option.
> > > >
> > > > Regards,
> > > > Tobi
> > > >
> > > > [1] http://gambaswiki.org/wiki/lang/wait
> > > > [2] http://gambaswiki.org/wiki/comp/gb/task
> > > >
> > > Thanks very much for the details.
> > >
> > > Regards,
> > >
> > > Dim
> > >
> > >
> > Is there any example of task fork use? I have a proyect who sending
> massive
> > e-mails to our customers and I guess that task can be a good solution...
> >
> > Regards
> >
>
> It normally works like this:
>
>   - You write a dedicated class, let's call it MyTask, to perform your
> task.
> This class must inherit the Task class.
>   - The constructor of MyTask can receive some arguments for the task, like
> an array of recipient addresses and bodies for your batch email.
>   - After the MyTask object is created, the process fork is postponed to
> the
> next invocation of the event loop. You may want to keep this in mind if
> you sometimes start a whole bunch of tasks at once or if you want to
> wait for the results of your task in the current procedure. To have the
> tasks started, you either have to enter the event loop, either by
> rolling up the current code path or by calling Wait.
>   - The interpreter will then fork and jump into the Main() method of the
> MyTask object. The standard output of the new process running the Task
> is redirected into the main program and raises Read events of the Task
> object. You can also return serialisable data from the Main() method
> which is transferred into the main process and which you can fetch
> these
> using MyTask.Value.
>   - Because returning a single value at the end of the task may not be
> sufficient, you normally end up using the standard output to
> communicate
> more regularly with the main process. I could imagine that you want to
> send messages of the form:
>
> "sent\tx\tn"
>
> to your main process, indicating that you just sent the x-th email of
> n emails total. The main process intercepts this string, has to parse
> it
> and can then update a ProcessBar or something. This is the way I use
> Tasks in my projects, anyway.
>
> An example can also be found in the gb.form component. The FileView class
> uses a background task named CTaskPreview to make preview of images in the
> background and send them to 

Re: [Gambas-user] App idle with long loops

2016-10-09 Thread Tobias Boege
On Sun, 09 Oct 2016, Jorge Carrión wrote:
> 2016-10-08 23:54 GMT+02:00 Demosthenes Koptsis :
> 
> > On 8/10/2016 19:09 μμ, Tobias Boege wrote:
> > > On Sat, 08 Oct 2016, Demosthenes Koptsis wrote:
> > >> Hello,
> > >>
> > >> i have very long (time consuming) For loops and my app is frozen until
> > >> loop is finished.
> > >>
> > >> for example i wget urls with a custom Sub which Shell("wgetURLS.sh") To
> > >> sOUTPUT
> > >>
> > >> 'get urls
> > >> For i = 0 To iDepth
> > >>   wgetURLS(i * 10)
> > >> Next
> > >>
> > >> Public Sub wgetURLS(iStart As Integer)
> > >> .
> > >>
> > >> Shell("wgetURLS.sh") To sOUTPUT
> > >>
> > >> .
> > >>
> > >> --
> > >>
> > >> Is there possible to set the gui idle and the same time run For...loops?
> > >>
> > > If you only want to refresh the GUI (e.g. if your For loops update a
> > > ProgressBar on your form and you want to update the value of that bar
> > > during the loop), then Wait [1] is sufficient.
> > >
> > > If you want the GUI to be fully operatable while your loops run in the
> > > background, you have to use a background Task [2]. As Gambas is single-
> > > threaded, Tasks are implemented as external processes which execute one
> > > of your classes. This limits the things you can do with Tasks (you cannot
> > > directly modify the main program, for example, but have to send data and
> > > status reports through a pipe from your Task to the main process and
> > > interpret them there). However, if all you want is loading some files via
> > > wget, that should not be a problem.
> > >
> > > Of course, there is also the gb.net.curl component which can download
> > files
> > > asynchronously. If you can use that (which depends on what you want to
> > do),
> > > you should.
> > >
> > > And as a fourth option, looking further into your code: if you want to
> > > execute shell scripts in a For loop, then don't use the Shell-To syntax
> > > but create a Process object instead and accumulate its output in Read
> > > events. The event loop will take care of everything and the GUI will be
> > > usable without any extra effort on your side.
> > >
> > > Finding the best solution depends, who would have thought, on what you
> > want
> > > to do *specifically*. Tasks are the most general and most cumbersome
> > option.
> > >
> > > Regards,
> > > Tobi
> > >
> > > [1] http://gambaswiki.org/wiki/lang/wait
> > > [2] http://gambaswiki.org/wiki/comp/gb/task
> > >
> > Thanks very much for the details.
> >
> > Regards,
> >
> > Dim
> >
> >
> Is there any example of task fork use? I have a proyect who sending massive
> e-mails to our customers and I guess that task can be a good solution...
> 
> Regards
> 

It normally works like this:

  - You write a dedicated class, let's call it MyTask, to perform your task.
This class must inherit the Task class.
  - The constructor of MyTask can receive some arguments for the task, like
an array of recipient addresses and bodies for your batch email.
  - After the MyTask object is created, the process fork is postponed to the
next invocation of the event loop. You may want to keep this in mind if
you sometimes start a whole bunch of tasks at once or if you want to
wait for the results of your task in the current procedure. To have the
tasks started, you either have to enter the event loop, either by
rolling up the current code path or by calling Wait.
  - The interpreter will then fork and jump into the Main() method of the
MyTask object. The standard output of the new process running the Task
is redirected into the main program and raises Read events of the Task
object. You can also return serialisable data from the Main() method
which is transferred into the main process and which you can fetch these
using MyTask.Value.
  - Because returning a single value at the end of the task may not be
sufficient, you normally end up using the standard output to communicate
more regularly with the main process. I could imagine that you want to
send messages of the form:

"sent\tx\tn"

to your main process, indicating that you just sent the x-th email of
n emails total. The main process intercepts this string, has to parse it
and can then update a ProcessBar or something. This is the way I use
Tasks in my projects, anyway.

An example can also be found in the gb.form component. The FileView class
uses a background task named CTaskPreview to make preview of images in the
background and send them to the main process once they're ready.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list

Re: [Gambas-user] App idle with long loops

2016-10-09 Thread Fabien Bodard
and also the mandelbrot example use the task class

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] App idle with long loops

2016-10-09 Thread Fabien Bodard
2016-10-08 23:54 GMT+02:00 Demosthenes Koptsis :
> On 8/10/2016 19:09 μμ, Tobias Boege wrote:
>> On Sat, 08 Oct 2016, Demosthenes Koptsis wrote:
>>> Hello,
>>>
>>> i have very long (time consuming) For loops and my app is frozen until
>>> loop is finished.
>>>
>>> for example i wget urls with a custom Sub which Shell("wgetURLS.sh") To
>>> sOUTPUT
>>>
>>> 'get urls
>>> For i = 0 To iDepth
>>>   wgetURLS(i * 10)
>>> Next
>>>
>>> Public Sub wgetURLS(iStart As Integer)
>>> .
>>>
>>> Shell("wgetURLS.sh") To sOUTPUT
>>>
>>> .
>>>
>>> --
>>>
>>> Is there possible to set the gui idle and the same time run For...loops?
>>>
>> If you only want to refresh the GUI (e.g. if your For loops update a
>> ProgressBar on your form and you want to update the value of that bar
>> during the loop), then Wait [1] is sufficient.
>>
>> If you want the GUI to be fully operatable while your loops run in the
>> background, you have to use a background Task [2]. As Gambas is single-
>> threaded, Tasks are implemented as external processes which execute one
>> of your classes. This limits the things you can do with Tasks (you cannot
>> directly modify the main program, for example, but have to send data and
>> status reports through a pipe from your Task to the main process and
>> interpret them there). However, if all you want is loading some files via
>> wget, that should not be a problem.
>>
>> Of course, there is also the gb.net.curl component which can download files
>> asynchronously. If you can use that (which depends on what you want to do),
>> you should.
>>
>> And as a fourth option, looking further into your code: if you want to
>> execute shell scripts in a For loop, then don't use the Shell-To syntax
>> but create a Process object instead and accumulate its output in Read
>> events. The event loop will take care of everything and the GUI will be
>> usable without any extra effort on your side.
>>
>> Finding the best solution depends, who would have thought, on what you want
>> to do *specifically*. Tasks are the most general and most cumbersome option.
for my feel, i prefers using multiple process objects or if i use
httpClient multiple client.

There is an exemple of use in the gb.map source (tilemap) of multiple
http server client
>>
>> Regards,
>> Tobi
>>
>> [1] http://gambaswiki.org/wiki/lang/wait
>> [2] http://gambaswiki.org/wiki/comp/gb/task
>>
> Thanks very much for the details.
>
> Regards,
>
> Dim
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] App idle with long loops

2016-10-09 Thread Karl Reinl
Am Sonntag, den 09.10.2016, 15:19 +0200 schrieb Jorge Carrión:
> It's an empty proyect, I'm afraid...
> Thanks for the trying.
> 
> Regards
> 
> 2016-10-09 14:36 GMT+02:00 Charlie Reinl :
> 
> > Am Sonntag, den 09.10.2016, 12:56 +0200 schrieb Jorge Carrión:
> > > Is there any example of task fork use? I have a proyect who sending
> > massive
> > > e-mails to our customers and I guess that task can be a good solution...
> > >
> > > Regards
> > >
> > > 2016-10-08 23:54 GMT+02:00 Demosthenes Koptsis :
> > >
> > > > On 8/10/2016 19:09 μμ, Tobias Boege wrote:
> > > > > On Sat, 08 Oct 2016, Demosthenes Koptsis wrote:
> > > > >> Hello,
> > > > >>
> > > > >> i have very long (time consuming) For loops and my app is frozen
> > until
> > > > >> loop is finished.
> > > > >>
> > > > >> for example i wget urls with a custom Sub which
> > Shell("wgetURLS.sh") To
> > > > >> sOUTPUT
> > > > >>
> > > > >> 'get urls
> > > > >> For i = 0 To iDepth
> > > > >>   wgetURLS(i * 10)
> > > > >> Next
> > > > >>
> > > > >> Public Sub wgetURLS(iStart As Integer)
> > > > >> .
> > > > >>
> > > > >> Shell("wgetURLS.sh") To sOUTPUT
> > > > >>
> > > > >> .
> > > > >>
> > > > >> --
> > > > >>
> > > > >> Is there possible to set the gui idle and the same time run
> > For...loops?
> > > > >>
> > > > > If you only want to refresh the GUI (e.g. if your For loops update a
> > > > > ProgressBar on your form and you want to update the value of that bar
> > > > > during the loop), then Wait [1] is sufficient.
> > > > >
> > > > > If you want the GUI to be fully operatable while your loops run in
> > the
> > > > > background, you have to use a background Task [2]. As Gambas is
> > single-
> > > > > threaded, Tasks are implemented as external processes which execute
> > one
> > > > > of your classes. This limits the things you can do with Tasks (you
> > cannot
> > > > > directly modify the main program, for example, but have to send data
> > and
> > > > > status reports through a pipe from your Task to the main process and
> > > > > interpret them there). However, if all you want is loading some
> > files via
> > > > > wget, that should not be a problem.
> > > > >
> > > > > Of course, there is also the gb.net.curl component which can download
> > > > files
> > > > > asynchronously. If you can use that (which depends on what you want
> > to
> > > > do),
> > > > > you should.
> > > > >
> > > > > And as a fourth option, looking further into your code: if you want
> > to
> > > > > execute shell scripts in a For loop, then don't use the Shell-To
> > syntax
> > > > > but create a Process object instead and accumulate its output in Read
> > > > > events. The event loop will take care of everything and the GUI will
> > be
> > > > > usable without any extra effort on your side.
> > > > >
> > > > > Finding the best solution depends, who would have thought, on what
> > you
> > > > want
> > > > > to do *specifically*. Tasks are the most general and most cumbersome
> > > > option.
> > > > >
> > > > > Regards,
> > > > > Tobi
> > > > >
> > > > > [1] http://gambaswiki.org/wiki/lang/wait
> > > > > [2] http://gambaswiki.org/wiki/comp/gb/task
> > > > >
> > > > Thanks very much for the details.
> > > >
> > > > Regards,
> > > >
> > > > Dim
> > > >
> > > >
> > > > 
> > > > --
> > > > Check out the vibrant tech community on one of the world's most
> > > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > > ___
> > > > Gambas-user mailing list
> > > > Gambas-user@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > > >
> > > 
> > --
> > > Check out the vibrant tech community on one of the world's most
> > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > ___
> > > Gambas-user mailing list
> > > Gambas-user@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> >
> > Salut
> >
> > I once found this one :
> > http://gambas.8142.n7.nabble.com/attachment/17635/0/TaskTest.zip
> >
> > It still exists, but don't remember if it worked.
> >
> >
> > --
> > Amicalement
> > Charlie

Salut Jorge,

go to bottom of that page 
http://gambas.8142.n7.nabble.com/gb-task-any-example-td17634.html 

there is the non empty project.

-- 
Amicalement
Charlie


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] App idle with long loops

2016-10-09 Thread Jorge Carrión
It's an empty proyect, I'm afraid...
Thanks for the trying.

Regards

2016-10-09 14:36 GMT+02:00 Charlie Reinl :

> Am Sonntag, den 09.10.2016, 12:56 +0200 schrieb Jorge Carrión:
> > Is there any example of task fork use? I have a proyect who sending
> massive
> > e-mails to our customers and I guess that task can be a good solution...
> >
> > Regards
> >
> > 2016-10-08 23:54 GMT+02:00 Demosthenes Koptsis :
> >
> > > On 8/10/2016 19:09 μμ, Tobias Boege wrote:
> > > > On Sat, 08 Oct 2016, Demosthenes Koptsis wrote:
> > > >> Hello,
> > > >>
> > > >> i have very long (time consuming) For loops and my app is frozen
> until
> > > >> loop is finished.
> > > >>
> > > >> for example i wget urls with a custom Sub which
> Shell("wgetURLS.sh") To
> > > >> sOUTPUT
> > > >>
> > > >> 'get urls
> > > >> For i = 0 To iDepth
> > > >>   wgetURLS(i * 10)
> > > >> Next
> > > >>
> > > >> Public Sub wgetURLS(iStart As Integer)
> > > >> .
> > > >>
> > > >> Shell("wgetURLS.sh") To sOUTPUT
> > > >>
> > > >> .
> > > >>
> > > >> --
> > > >>
> > > >> Is there possible to set the gui idle and the same time run
> For...loops?
> > > >>
> > > > If you only want to refresh the GUI (e.g. if your For loops update a
> > > > ProgressBar on your form and you want to update the value of that bar
> > > > during the loop), then Wait [1] is sufficient.
> > > >
> > > > If you want the GUI to be fully operatable while your loops run in
> the
> > > > background, you have to use a background Task [2]. As Gambas is
> single-
> > > > threaded, Tasks are implemented as external processes which execute
> one
> > > > of your classes. This limits the things you can do with Tasks (you
> cannot
> > > > directly modify the main program, for example, but have to send data
> and
> > > > status reports through a pipe from your Task to the main process and
> > > > interpret them there). However, if all you want is loading some
> files via
> > > > wget, that should not be a problem.
> > > >
> > > > Of course, there is also the gb.net.curl component which can download
> > > files
> > > > asynchronously. If you can use that (which depends on what you want
> to
> > > do),
> > > > you should.
> > > >
> > > > And as a fourth option, looking further into your code: if you want
> to
> > > > execute shell scripts in a For loop, then don't use the Shell-To
> syntax
> > > > but create a Process object instead and accumulate its output in Read
> > > > events. The event loop will take care of everything and the GUI will
> be
> > > > usable without any extra effort on your side.
> > > >
> > > > Finding the best solution depends, who would have thought, on what
> you
> > > want
> > > > to do *specifically*. Tasks are the most general and most cumbersome
> > > option.
> > > >
> > > > Regards,
> > > > Tobi
> > > >
> > > > [1] http://gambaswiki.org/wiki/lang/wait
> > > > [2] http://gambaswiki.org/wiki/comp/gb/task
> > > >
> > > Thanks very much for the details.
> > >
> > > Regards,
> > >
> > > Dim
> > >
> > >
> > > 
> > > --
> > > Check out the vibrant tech community on one of the world's most
> > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > ___
> > > Gambas-user mailing list
> > > Gambas-user@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> > 
> --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > ___
> > Gambas-user mailing list
> > Gambas-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
> Salut
>
> I once found this one :
> http://gambas.8142.n7.nabble.com/attachment/17635/0/TaskTest.zip
>
> It still exists, but don't remember if it worked.
>
>
> --
> Amicalement
> Charlie
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] App idle with long loops

2016-10-09 Thread Charlie Reinl
Am Sonntag, den 09.10.2016, 12:56 +0200 schrieb Jorge Carrión:
> Is there any example of task fork use? I have a proyect who sending massive
> e-mails to our customers and I guess that task can be a good solution...
> 
> Regards
> 
> 2016-10-08 23:54 GMT+02:00 Demosthenes Koptsis :
> 
> > On 8/10/2016 19:09 μμ, Tobias Boege wrote:
> > > On Sat, 08 Oct 2016, Demosthenes Koptsis wrote:
> > >> Hello,
> > >>
> > >> i have very long (time consuming) For loops and my app is frozen until
> > >> loop is finished.
> > >>
> > >> for example i wget urls with a custom Sub which Shell("wgetURLS.sh") To
> > >> sOUTPUT
> > >>
> > >> 'get urls
> > >> For i = 0 To iDepth
> > >>   wgetURLS(i * 10)
> > >> Next
> > >>
> > >> Public Sub wgetURLS(iStart As Integer)
> > >> .
> > >>
> > >> Shell("wgetURLS.sh") To sOUTPUT
> > >>
> > >> .
> > >>
> > >> --
> > >>
> > >> Is there possible to set the gui idle and the same time run For...loops?
> > >>
> > > If you only want to refresh the GUI (e.g. if your For loops update a
> > > ProgressBar on your form and you want to update the value of that bar
> > > during the loop), then Wait [1] is sufficient.
> > >
> > > If you want the GUI to be fully operatable while your loops run in the
> > > background, you have to use a background Task [2]. As Gambas is single-
> > > threaded, Tasks are implemented as external processes which execute one
> > > of your classes. This limits the things you can do with Tasks (you cannot
> > > directly modify the main program, for example, but have to send data and
> > > status reports through a pipe from your Task to the main process and
> > > interpret them there). However, if all you want is loading some files via
> > > wget, that should not be a problem.
> > >
> > > Of course, there is also the gb.net.curl component which can download
> > files
> > > asynchronously. If you can use that (which depends on what you want to
> > do),
> > > you should.
> > >
> > > And as a fourth option, looking further into your code: if you want to
> > > execute shell scripts in a For loop, then don't use the Shell-To syntax
> > > but create a Process object instead and accumulate its output in Read
> > > events. The event loop will take care of everything and the GUI will be
> > > usable without any extra effort on your side.
> > >
> > > Finding the best solution depends, who would have thought, on what you
> > want
> > > to do *specifically*. Tasks are the most general and most cumbersome
> > option.
> > >
> > > Regards,
> > > Tobi
> > >
> > > [1] http://gambaswiki.org/wiki/lang/wait
> > > [2] http://gambaswiki.org/wiki/comp/gb/task
> > >
> > Thanks very much for the details.
> >
> > Regards,
> >
> > Dim
> >
> >
> > 
> > --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > ___
> > Gambas-user mailing list
> > Gambas-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> --
> Check out the vibrant tech community on one of the world's most 
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 

Salut

I once found this one :
http://gambas.8142.n7.nabble.com/attachment/17635/0/TaskTest.zip 

It still exists, but don't remember if it worked.


-- 
Amicalement
Charlie


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] App idle with long loops

2016-10-09 Thread Jorge Carrión
Is there any example of task fork use? I have a proyect who sending massive
e-mails to our customers and I guess that task can be a good solution...

Regards

2016-10-08 23:54 GMT+02:00 Demosthenes Koptsis :

> On 8/10/2016 19:09 μμ, Tobias Boege wrote:
> > On Sat, 08 Oct 2016, Demosthenes Koptsis wrote:
> >> Hello,
> >>
> >> i have very long (time consuming) For loops and my app is frozen until
> >> loop is finished.
> >>
> >> for example i wget urls with a custom Sub which Shell("wgetURLS.sh") To
> >> sOUTPUT
> >>
> >> 'get urls
> >> For i = 0 To iDepth
> >>   wgetURLS(i * 10)
> >> Next
> >>
> >> Public Sub wgetURLS(iStart As Integer)
> >> .
> >>
> >> Shell("wgetURLS.sh") To sOUTPUT
> >>
> >> .
> >>
> >> --
> >>
> >> Is there possible to set the gui idle and the same time run For...loops?
> >>
> > If you only want to refresh the GUI (e.g. if your For loops update a
> > ProgressBar on your form and you want to update the value of that bar
> > during the loop), then Wait [1] is sufficient.
> >
> > If you want the GUI to be fully operatable while your loops run in the
> > background, you have to use a background Task [2]. As Gambas is single-
> > threaded, Tasks are implemented as external processes which execute one
> > of your classes. This limits the things you can do with Tasks (you cannot
> > directly modify the main program, for example, but have to send data and
> > status reports through a pipe from your Task to the main process and
> > interpret them there). However, if all you want is loading some files via
> > wget, that should not be a problem.
> >
> > Of course, there is also the gb.net.curl component which can download
> files
> > asynchronously. If you can use that (which depends on what you want to
> do),
> > you should.
> >
> > And as a fourth option, looking further into your code: if you want to
> > execute shell scripts in a For loop, then don't use the Shell-To syntax
> > but create a Process object instead and accumulate its output in Read
> > events. The event loop will take care of everything and the GUI will be
> > usable without any extra effort on your side.
> >
> > Finding the best solution depends, who would have thought, on what you
> want
> > to do *specifically*. Tasks are the most general and most cumbersome
> option.
> >
> > Regards,
> > Tobi
> >
> > [1] http://gambaswiki.org/wiki/lang/wait
> > [2] http://gambaswiki.org/wiki/comp/gb/task
> >
> Thanks very much for the details.
>
> Regards,
>
> Dim
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user