Page 1 of 1

How to make a repeated cicle working??

Posted: Fri Mar 04, 2016 12:09 pm
by Fasasoftware
Dear friend,
i'm trying to test my code... but this don't work...the firefox is frozen... i need to make a pause and refresh my image every second and repeat it after a second....

how i can do it??

thanks a lot lestroso :oops:

Code: Select all


If OpenWindow(0, 0, 0, 1000, 500, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  Repeat
    WebGadget(0, 10, 10, 900, 480, "http://freeserv.dukascopy.com/ChartServer/chart?stock_id=1020&width=325&height=275&interval=10&points_number=60&view_type=candle&rfi=true")
    For i = 1 To 2
     Next i
ForEver
EndIf
 

Re: How to make a repeated cicle working??

Posted: Fri Mar 04, 2016 1:35 pm
by Fred
Try to use a timer instead with AddWindowTimer()

Re: How to make a repeated cicle working??

Posted: Fri Mar 04, 2016 3:28 pm
by Peter

Code: Select all

#myWindow = 0
#myWebGadget = 0
#myTimer = 0

Global URL.s = "http://freeserv.dukascopy.com/ChartServer/chart?stock_id=1020&width=325&height=275&interval=10&points_number=60&view_type=candle&rfi=true"

Procedure Reload()
  Debug "Reload..."
  SetGadgetText(#myWebGadget, URL)
EndProcedure

OpenWindow(#myWindow, 0, 0, 1000, 500, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadget(#myWebGadget, 10, 10, 900, 480, URL)
AddWindowTimer(#myWindow, #myTimer, 5000) ; 5 seconds...
BindEvent(#PB_Event_Timer, @Reload(), #myWindow, #myWebGadget)
Greetings ... Peter

Re: How to make a repeated cicle working??

Posted: Fri Mar 04, 2016 9:43 pm
by Fasasoftware
Thank a lot to everybody....now i'll try your code Peter....You are always so kind....

Thanks a lot Lestroso :D

www.fasasoftware.com