Just as a reminder: VFP 6.0 is still in beta. I personnaly don't pay any attention to speed issue when a software is still in beta.
>Run the following code under VFP 5 and VFP 6, you'll see that it takes over 10 times as long to run under VFP 6.
>
>#DEFINE NO_OF_FORMS 20
>#DEFINE NO_OF_PAGES 18
>#DEFINE NO_OF_TEXTBOXES 10
>
>DEBUG
>DEBUGOUT ''
>
>PUBLIC gnStart
>gnStart = SECONDS()
>
>FOR lni = 1 TO NO_OF_FORMS
> lcfrmName = 'oform'+ALLTR(STR(lni))
> STORE CREATEOBJECT('perform') TO (lcfrmname)
> WITH EVAL(lcfrmname)
> .Caption = SUBSTR(lcfrmname, 2)
> .Show()
> ENDWITH
>ENDFOR
>
>FOR lnj = 1 TO _SCREEN.FORMCOUNT
> WITH EVAL(lcfrmName + ALLTRIM(STR(lnj))
> .Show()
> lnstart = SECONDS()
> FOR lnk = 1 TO .pf1.PAGECOUNT
> .pf1.ACTIVEPAGE = lnk
> ENDFOR
> DEBUGOUT 'Form '+ ALLTR(STR(lnj)) ;
> + ': ' ;
> + alltr(str(SECONDS() - lnstart,5,2))
> ENDWITH
>ENDFOR
>
>DEBUGOUT 'All forms: ' ;
> +alltr(str(SECONDS() - gnStart,5,2))
>
>READ EVENTS
>
>DEFINE CLASS perfform AS FORM
> HEIGHT = 350
> ADD OBJECT pf1 AS PAGEFRAME WITH ;
> PAGECOUNT = 0
> PROC pf1.INIT()
> THIS.HEIGHT = THIS.PARENT.HEIGHT - 5
> FOR lnj = 1 TO NO_OF_PAGES
> THIS.ADDOBJECT('pg'+ALLTR(STR(lnj)), 'pg')
> ENDF
> ENDPRO
> PROC DESTROY
> IF _SCREEN.FORMCOUNT = 1
> DEBUGOUT 'Release forms: ' ;
> +alltr(str(SECONDS() - gnStart,5,2))
> ENDIF
>ENDDEFINE
>
>DEFINE CLASS pg AS PAGE
> PROC ACTIVATE()
> IF TYPE('this.cntPage') # 'O'
> THIS.ADDOBJECT("cntPage", "cnPageContainer")
> ENDIF
> ENDPRO
>ENDDE
>
>DEFINE CLASS cnpagecontainer AS CONTAINER
> NAME = "cnpagecontainer"
> VISIBLE = .T.
> Top = 5
> ADD OBJECT cmd1 AS COMMANDBUTTON WITH ;
> LEFT = 180, ;
> TOP = 20, ;
> CAPTION = 'Quit', ;
> VISIBLE = .T.
>
> PROC INIT()
> THIS.HEIGHT = THIS.PARENT.PARENT.HEIGHT - 20
> THIS.WIDTH = THIS.PARENT.PARENT.WIDTH - 5
> FOR lnp = 1 TO NO_OF_TEXTBOXES
> THIS.ADDOBJECT('lbl'+ALLTR(STR(lnp)), 'label')
> WITH THIS.CONTROLS(lnp+1)
> .LEFT = 10
> .TOP = 25*(lnp-1)+ 2
> .WIDTH = 80
> .NAME = 'lbl'+ALLTR(STR(lnp))
> .VISIBLE = .T.
> ENDWI
> ENDF
> FOR lnq = lnp TO (2 * lnp) - 2
> THIS.ADDOBJECT('txt'+ALLTR(STR(lnq)), 'textbox')
> WITH THIS.CONTROLS(lnq+1)
> .HEIGHT = 23
> .LEFT = 90
> .TOP = 25*(lnq-lnp)+ 2
> .WIDTH = 80
> .NAME = 'txt'+ALLTR(STR(lnq))
> .VISIBLE = .T.
> ENDWI
> ENDF
> ENDPRO
>
> PROC cmd1.CLICK
> gnStart = SECONDS()
> CLEAR EVENTS
> ENDPROC
>
>ENDDEFINE
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only