Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: surinder singh
  Where is surinder singh?
 mumbai
 India
 surinder singh
 Tags
Subject: RE: label and date and time
Thread ID: 188787 Message ID: 189174 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Forms
Date: Wednesday, August 13, 2008 4:14:02 PM         
   


> > Surinder
> >
> > It is much more than once a second. Try
>
> yes you are right.
> but can't understand how does it refresh time after every second when we set caption as TIME()
> -----------------------------------------------------------------------------------------------
> Regards
> Surinder Singh
> Email: sur200@indiatimes.com
> Check my blog for details: http://weblogs.foxite.com/sur200
> ----------------------------------------------------------------------------------------
> *If you understand what you're doing, then you're not learning anything.

Hi Surinder & Tushar
Paint method refresh the time you set about 1240 once/second (on my PC)!
As i say it consume too memory and i think it is not suggested to work with it.
Try this code below
yform=createobject('asup')
yform.show
read events
return

*-- Time Stamp:   08/13/08 03:04:10 PM
DEFINE CLASS asup AS form
	Top = 48
	Left = 222
	Height = 333
	Width = 375
	DoCreate = .T.
	Caption = "Calculate refreshing with PAint method"
	MaxButton = .F.
	KeyPreview = .T.
	Name = "Form1"

	ADD OBJECT label1 AS label WITH ;
		BackStyle = 0, ;
		Caption = "Label1", ;
		Height = 72, ;
		Left = 48, ;
		Top = 12, ;
		Width = 288, ;
		Name = "Label1"

	ADD OBJECT label2 AS label WITH ;
		BackStyle = 0, ;
		Caption = "Label2", ;
		Height = 61, ;
		Left = 48, ;
		Top = 89, ;
		Width = 288, ;
		Name = "Label2"

	ADD OBJECT edit1 AS editbox WITH ;
		Height = 85, ;
		Left = 13, ;
		ReadOnly = .T., ;
		Top = 158, ;
		Width = 348, ;
		DisabledBackColor = RGB(255,255,255), ;
		Name = "Edit1"

	ADD OBJECT label3 AS label WITH ;
		WordWrap = .T., ;
		BackStyle = 0, ;
		Caption = "Note that Paint method consumes all memory.You cannot access to scroll of editbox for ex.", ;
		Height = 37, ;
		Left = 12, ;
		Top = 252, ;
		Width = 349, ;
		Name = "Label3"

	ADD OBJECT label4 AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Press ESC to stop and see results", ;
		Height = 17, ;
		Left = 60, ;
		Top = 300, ;
		Width = 192, ;
		Name = "Label4"

	PROCEDURE Init
		publi t0,n,author
		set curs off
		t0=seconds()
		n=0
		author=.t.
		create cursor ycurs (Taux_refresh n(10.2))
	ENDPROC

	PROCEDURE Paint
		if author=.t.
		n=n+1
		this.label1.Caption="Count="+trans(n)
		this.label2.caption="Time="+time()


		if  mod(seconds()-t0,5)=0
		 tauxrefresh=n/(seconds()-t0)
		thisform.edit1.value=thisform.edit1.value+"taux_refresh="+trans(tauxrefresh)+" once/sec."+chr(13)
		sele ycurs 
		appe blan
		repl taux_refresh with tauxrefresh
		endi
		       
		 endi
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		if nkeycode=27
		author=.f.
		sele ycurs
		average taux_refresh to x
		messagebox("Taux_refresh with Paint Method="+trans(x)+" one/second"+chr(13)+" Your time is refresh all this value per second!",0+32+4096)
		set curs on
		endi
	ENDPROC
    PROCEDURE DESTROY
    clea events
    ENDPROC

ENDDEFINE

Best regards
Yousfi Benameur

ENTIRE THREAD

label and date and time Posted by Jake Pomperada @ 8/12/2008 3:47:22 AM
RE: label and date and time Posted by Glenn Villar @ 8/12/2008 4:01:02 AM
RE: label and date and time Posted by Christian Tabligan @ 8/12/2008 6:23:19 AM
RE: label and date and time Posted by surinder singh @ 8/12/2008 7:25:48 AM
RE: label and date and time Posted by Christian Tabligan @ 8/12/2008 7:55:23 AM
RE: label and date and time Posted by surinder singh @ 8/12/2008 8:10:42 AM
RE: label and date and time Posted by Christian Tabligan @ 8/12/2008 8:22:05 AM
RE: label and date and time Posted by Yousfi Benameur @ 8/12/2008 10:28:38 PM
RE: label and date and time Posted by surinder singh @ 8/13/2008 9:08:33 AM
RE: label and date and time Posted by Yousfi Benameur @ 8/13/2008 11:15:01 AM
RE: label and date and time Posted by surinder singh @ 8/13/2008 11:23:11 AM
RE: label and date and time Posted by tushar @ 8/13/2008 1:45:31 PM
RE: label and date and time Posted by surinder singh @ 8/13/2008 1:52:11 PM
RE: label and date and time Posted by tushar @ 8/13/2008 2:49:29 PM
RE: label and date and time Posted by Yousfi Benameur @ 8/13/2008 4:14:02 PM
RE: label and date and time Posted by Christian Tabligan @ 8/14/2008 2:08:38 AM