Page 1 of 1

another probably simple question

Posted: Thu Nov 01, 2012 10:08 am
by BruceN
I have an 'about' box that displays the number of 'active' users.
users := user_count()
@ 3.5, 40 dcsay str( users ) saysize 25 sayleft

That gives me a fixed value. That is, if another user logs in while the about box is open the value doesn't change.

How would I make that update say every 2 seconds?

I can see a function CheckUsers() , something like:

do while .t.
users := user_count()
sleep(200)
loop

but how would I call it so we don't get stuck in the loop and the code can get to the dcread?

thanks

Re: another probably simple question

Posted: Thu Nov 01, 2012 4:50 pm
by rdonnay

Code: Select all

@ @ 3.5, 40 dcsay {||str( users )} saysize 25 sayleft

DCREAD GUI EVAL {||oTimer := DC_SetTimerEvent():new(200,{||DC_GetRefresh(GetList)})}

oTimer:destroy()