How to make a repeated cicle working??

Just starting out? Need help? Post your questions and find answers here.
Fasasoftware
Posts: 47
Joined: Tue May 26, 2015 11:22 pm

How to make a repeated cicle working??

Post 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
 
Fred
Site Admin
Posts: 1821
Joined: Mon Feb 24, 2014 10:51 am

Re: How to make a repeated cicle working??

Post by Fred »

Try to use a timer instead with AddWindowTimer()
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: How to make a repeated cicle working??

Post 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
Fasasoftware
Posts: 47
Joined: Tue May 26, 2015 11:22 pm

Re: How to make a repeated cicle working??

Post 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
Post Reply