[Gambas-user] progress bar and shell command which takes ages

lozza1978 piresl at ...626...
Tue Jan 1 18:09:40 CET 2008


Hi there,

Thanks for your reply,
I have tried the following code but im still not sure how to implement the
progress bar, please bare with me while i try and explain the issues im
having.

When the user clicks the button, it launches 

StartTheProcess()

this then updates the progress bar to

ProgressBar1.Value= "0.2"

But the progress bar never updates anymore (stays at 2%) and im wondering if
the EXEC is actually still running the command?

hProc=Exec[Application,param1,param2...] FOR INPUT 
Object.Attach(hProc,Me,"hProc") 

Should the Progress bar update while the EXEC command is still running?

Thanks so much for your help.


Daniel Campos-3 wrote:
> 
> May you could do it without loops, use EXEC FOR INPUT or FOR READ, and
> read the progress from the application (I assume the console
> application pushes a text progress bar or a percentage indicator
> during the process), then refresh the ProgressBar anytime you find a
> Process_Read() event, something like
> 
> PUBLIC hProc AS Process
> 
> PUBLIC SUB hProc_Read()
> 
> Dim Buf as String
> 
> READ #hProc,Buf,Lof(hProc)
> 
> ' Parse the buffer here
> 
> ProgressBar1.Value=whatever
> 
> END
> 
> PUBLIC SUB StartTheProcess()
> 
> hProc=Exec[Application,param1,param2...] FOR INPUT
> Object.Attach(hProc,Me,"hProc")
> 
> END
> 
> 
> 
> 
> 2007/12/24, lawrence pires <piresl at ...626...>:
>> i would like to integrate a progress bar  but not 100% sure how to do
>> this,
>>
>> I am using EXEC command to convert a music file from WAA to MP3 this
>> process
>> can take 3-4 minutes, and i would some how like to use the progress bar
>> to
>> show the progress of the conversion. (is it possible?)
>>
>> Am I right in saying the the progress bar will only work with a loop? &
>> how
>> would i do the loop with the EXEC command?
>>
>> thanks for reading
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 

-- 
View this message in context: http://www.nabble.com/progress-bar-and-shell-command-which-takes-ages-tp14488332p14568220.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list