NetTalk Central

Author Topic: Timer on browse  (Read 4669 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Timer on browse
« on: April 16, 2012, 01:47:21 AM »
I have found the timer property on a browse but not quite sure how to use it.

I set the interval to 1000 but not quite sure what the Refresh drop down box does.

Also I cannot find an embed to put any code in for the timer event.

Many thanks

john

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Timer on browse
« Reply #1 on: April 16, 2012, 02:53:00 AM »
Look for this:  p_web._RegisterDivEx(loc:divname,1000)  (1000 is the timer parameter)

This is where the timer fires.  There is an embed right after this. 

Refresh: If the timer is set then you can determine the nature of the browse refresh. Does it start at the top of the browse, jump to the bottom (the most recent records) or remain in the current position.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Timer on browse
« Reply #2 on: April 16, 2012, 03:00:28 AM »
Excellent Don - thank you.

John

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Timer on browse
« Reply #3 on: April 16, 2012, 04:27:46 AM »
You are very welcome!
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Timer on browse
« Reply #4 on: April 16, 2012, 11:04:56 AM »
The CallBrowse routine will be called on each timer, as Don suggests, but this will be _after_ the browse has generated. If you want to embed before the browse generates then use the top of the GenerateBrowse routine.

Bear in mind that a "fast" timer is a bad idea. Anything less than 10 seconds (10000) is a fast timer. Except in cases where you know you will only have 1 user connected at a time.

Timers can easily bring your server to it's knees if not used very carefully.

cheers
Bruce

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Timer on browse
« Reply #5 on: April 16, 2012, 02:36:22 PM »
Thanks Bruce - an excellent point.

In my case it is for our online user admin system and want to update the users logged in window every 30 seconds probably (I just used 1000 as an example). There would only ever be 2 people max using it at ay one time.

Saves me using Remote Desktop to view the Web Server.

But a very valid and useful tip.

Thanks

John