Help with-> Form Design Issues 
Author Message
 Help with-> Form Design Issues

Hi All,

I am a newbie (6 weeks with foxpro, but 15+ years as {*filter*} programmer)

My questions are primarily aimed toward  "app design" issues:-

Advice wanted on 'Cursor' issues..

When designing a form, one can add 'cursors' to the dataenvironment.
(which is great cos, file handling is virtually automatic etc)

However, the Form "load time" is unacceptable!
(i.e. the time taken to open the form when 3 cursors are
attached is too slow (for a commercial product)....

If the regular approach is taken i.e....
Open the 3 files in the form's 'load' function..... (i.e No Cursors),
(close em when frorm is closed)

Form load time is quite acceptable...

Question basically is: Why use Cursors??
(I will definitely Not use them in this case.......)

Your comments would be appreciated.

Derek
Australia.



Thu, 06 Mar 2003 03:00:00 GMT  
 Help with-> Form Design Issues

Derek,

I do not share you opinion that adding cursors to the DE is to slow.  Maybe
there is another issue like adding large (remote) views

the cursors you attached to the data environment are either views are
tables.  In the DE the 'cursors' are supposed to be opened faster since vfp
uses 'lower level' open routines.  So the best is to add them in the DE.

There are a few exception to that.

(1) if you want to work with a 'real' cursor you have to create them in the
load() of the form.
ie
select 0
create cursor xxx { f1 c(4), f4 c(5), ... )
those can be filled with a method and you can use them as RecordSource for a
grid or anything else

(2) if you have a form class which you instantiate with  xxx =
createobject(classname, ....) then you will see that classes have no DE and
hence you have no alternative but to open the tables and the views in the
load() event

----------------------------------------------------------------------------
---------------------

|
| Hi All,
|
| I am a newbie (6 weeks with foxpro, but 15+ years as {*filter*} programmer)
|
| My questions are primarily aimed toward  "app design" issues:-
|
| Advice wanted on 'Cursor' issues..
|
| When designing a form, one can add 'cursors' to the dataenvironment.
| (which is great cos, file handling is virtually automatic etc)
|
| However, the Form "load time" is unacceptable!
| (i.e. the time taken to open the form when 3 cursors are
| attached is too slow (for a commercial product)....
|
| If the regular approach is taken i.e....
| Open the 3 files in the form's 'load' function..... (i.e No Cursors),
| (close em when frorm is closed)
|
| Form load time is quite acceptable...
|
| Question basically is: Why use Cursors??
| (I will definitely Not use them in this case.......)
|
| Your comments would be appreciated.
|
| Derek
| Australia.
|
|



Thu, 06 Mar 2003 03:00:00 GMT  
 Help with-> Form Design Issues

Hi Gregory, thank you for your input..... it is appreciated,
and....It makes me think perhaps I am missing some concept!

My comments were not an 'opinion' Gregory,
they are fact...

There are no other issues....

These are forms which were designed to be extremely simple,
bare bones only - with testing in mind.

The choices were:-
a). Open the form with 3 tables in the DE
VS
b). Open the form with NO tables in the DE
     but the 3 tables to be opened regularly in the
     forms "load" .... ie. select/use

Result......
Option b.... is orders of magnitude faster,
(I am surprised by this!)

and as said before..... Using test (a) the load
time is indeed unacceptable. (also proved this
by doing traces....  (didn't need the traces, the
difference in load speed is Very obvious)

My question therfore remains.... why use cursors?

I hope to be enlighted by responses......

Thank you again!
Derek.


Quote:
> Derek,

> I do not share you opinion that adding cursors to the DE is to slow.
Maybe
> there is another issue like adding large (remote) views

> the cursors you attached to the data environment are either views are
> tables.  In the DE the 'cursors' are supposed to be opened faster since
vfp
> uses 'lower level' open routines.  So the best is to add them in the DE.

> There are a few exception to that.

> (1) if you want to work with a 'real' cursor you have to create them in
the
> load() of the form.
> ie
> select 0
> create cursor xxx { f1 c(4), f4 c(5), ... )
> those can be filled with a method and you can use them as RecordSource for
a
> grid or anything else

> (2) if you have a form class which you instantiate with  xxx =
> createobject(classname, ....) then you will see that classes have no DE
and
> hence you have no alternative but to open the tables and the views in the
> load() event

> --------------------------------------------------------------------------
--
> ---------------------


> |
> | Hi All,
> |
> | I am a newbie (6 weeks with foxpro, but 15+ years as {*filter*}
programmer)
> |
> | My questions are primarily aimed toward  "app design" issues:-
> |
> | Advice wanted on 'Cursor' issues..
> |
> | When designing a form, one can add 'cursors' to the dataenvironment.
> | (which is great cos, file handling is virtually automatic etc)
> |
> | However, the Form "load time" is unacceptable!
> | (i.e. the time taken to open the form when 3 cursors are
> | attached is too slow (for a commercial product)....
> |
> | If the regular approach is taken i.e....
> | Open the 3 files in the form's 'load' function..... (i.e No Cursors),
> | (close em when frorm is closed)
> |
> | Form load time is quite acceptable...
> |
> | Question basically is: Why use Cursors??
> | (I will definitely Not use them in this case.......)
> |
> | Your comments would be appreciated.
> |
> | Derek
> | Australia.
> |
> |



Thu, 06 Mar 2003 03:00:00 GMT  
 Help with-> Form Design Issues

Hi
You can improve loadtime by marking the cursors object property
NoDataOnLoad, same as USE .. NODATA, and then  in the case of paqrameterized
views REQUERY('viewname') when a filter variable value has been specified by
the user. That's standard practice in the case of views. You can also let
some pages of a pageframe handle thei own data in the UIEnable the first
time the page is accessed. Someone has written a PD program to convert DE
information to a  program to be run in the forms load.
-Anders


Quote:

> Hi All,

> I am a newbie (6 weeks with foxpro, but 15+ years as {*filter*} programmer)

> My questions are primarily aimed toward  "app design" issues:-

> Advice wanted on 'Cursor' issues..

> When designing a form, one can add 'cursors' to the dataenvironment.
> (which is great cos, file handling is virtually automatic etc)

> However, the Form "load time" is unacceptable!
> (i.e. the time taken to open the form when 3 cursors are
> attached is too slow (for a commercial product)....

> If the regular approach is taken i.e....
> Open the 3 files in the form's 'load' function..... (i.e No Cursors),
> (close em when frorm is closed)

> Form load time is quite acceptable...

> Question basically is: Why use Cursors??
> (I will definitely Not use them in this case.......)

> Your comments would be appreciated.

> Derek
> Australia.



Thu, 06 Mar 2003 03:00:00 GMT  
 Help with-> Form Design Issues
Derek,

(1) I am surprised also that the use in the load() runs faster.  But then I
must confess that it was never an issue for me.

(2) As to your question 'why use cursors' I think that 'cursor' is a generic
term which can be
    - an opened table
    - an opened view
    - a result of a select ... into cursor
    - a result of create cursor

  So if they speak of cursors in the DE it's either a table or a view
--------------------------------------------------------------------

|
| Hi Gregory, thank you for your input..... it is appreciated,
| and....It makes me think perhaps I am missing some concept!
|
| My comments were not an 'opinion' Gregory,
| they are fact...
|
| There are no other issues....
|
| These are forms which were designed to be extremely simple,
| bare bones only - with testing in mind.
|
| The choices were:-
| a). Open the form with 3 tables in the DE
| VS
| b). Open the form with NO tables in the DE
|      but the 3 tables to be opened regularly in the
|      forms "load" .... ie. select/use
|
| Result......
| Option b.... is orders of magnitude faster,
| (I am surprised by this!)
|
| and as said before..... Using test (a) the load
| time is indeed unacceptable. (also proved this
| by doing traces....  (didn't need the traces, the
| difference in load speed is Very obvious)
|
| My question therfore remains.... why use cursors?
|
| I hope to be enlighted by responses......
|
| Thank you again!
| Derek.
|
|
|


| > Derek,
| >
| > I do not share you opinion that adding cursors to the DE is to slow.
| Maybe
| > there is another issue like adding large (remote) views
| >
| > the cursors you attached to the data environment are either views are
| > tables.  In the DE the 'cursors' are supposed to be opened faster since
| vfp
| > uses 'lower level' open routines.  So the best is to add them in the DE.
| >
| > There are a few exception to that.
| >
| > (1) if you want to work with a 'real' cursor you have to create them in
| the
| > load() of the form.
| > ie
| > select 0
| > create cursor xxx { f1 c(4), f4 c(5), ... )
| > those can be filled with a method and you can use them as RecordSource
for
| a
| > grid or anything else
| >
| > (2) if you have a form class which you instantiate with  xxx =
| > createobject(classname, ....) then you will see that classes have no DE
| and
| > hence you have no alternative but to open the tables and the views in
the
| > load() event
| >
|

Quote:
> --------------------------------------------------------------------------

| --
| > ---------------------


| > |
| > | Hi All,
| > |
| > | I am a newbie (6 weeks with foxpro, but 15+ years as {*filter*}
| programmer)
| > |
| > | My questions are primarily aimed toward  "app design" issues:-
| > |
| > | Advice wanted on 'Cursor' issues..
| > |
| > | When designing a form, one can add 'cursors' to the dataenvironment.
| > | (which is great cos, file handling is virtually automatic etc)
| > |
| > | However, the Form "load time" is unacceptable!
| > | (i.e. the time taken to open the form when 3 cursors are
| > | attached is too slow (for a commercial product)....
| > |
| > | If the regular approach is taken i.e....
| > | Open the 3 files in the form's 'load' function..... (i.e No Cursors),
| > | (close em when frorm is closed)
| > |
| > | Form load time is quite acceptable...
| > |
| > | Question basically is: Why use Cursors??
| > | (I will definitely Not use them in this case.......)
| > |
| > | Your comments would be appreciated.
| > |
| > | Derek
| > | Australia.
| > |
| > |
| >
| >
|
|


Thu, 06 Mar 2003 03:00:00 GMT  
 Help with-> Form Design Issues
Gregory,

Your SELECT 0 | CREATE CURSOR is probably one of those "just to make sure"
habits, but the docs on CREATE CURSOR say "The temporary table is opened in
the lowest available work area..." so the SELECT 0 is not necessary.

Saves a whole line of code!  ;-)

--

Cindy Winegarden
Microsoft Certified Professional, Visual FoxPro

Duke Children's Information Systems
Duke University Medical Center


| Derek,
|
| I do not share you opinion that adding cursors to the DE is to slow.
Maybe
| there is another issue like adding large (remote) views
|
| the cursors you attached to the data environment are either views are
| tables.  In the DE the 'cursors' are supposed to be opened faster since
vfp
| uses 'lower level' open routines.  So the best is to add them in the DE.
|
| There are a few exception to that.
|
| (1) if you want to work with a 'real' cursor you have to create them in
the
| load() of the form.
| ie
| select 0
| create cursor xxx { f1 c(4), f4 c(5), ... )
| those can be filled with a method and you can use them as RecordSource for
a
| grid or anything else
|
| (2) if you have a form class which you instantiate with  xxx =
| createobject(classname, ....) then you will see that classes have no DE
and
| hence you have no alternative but to open the tables and the views in the
| load() event
|
| --------------------------------------------------------------------------
--
| ---------------------


| |
| | Hi All,
| |
| | I am a newbie (6 weeks with foxpro, but 15+ years as {*filter*}
programmer)
| |
| | My questions are primarily aimed toward  "app design" issues:-
| |
| | Advice wanted on 'Cursor' issues..
| |
| | When designing a form, one can add 'cursors' to the dataenvironment.
| | (which is great cos, file handling is virtually automatic etc)
| |
| | However, the Form "load time" is unacceptable!
| | (i.e. the time taken to open the form when 3 cursors are
| | attached is too slow (for a commercial product)....
| |
| | If the regular approach is taken i.e....
| | Open the 3 files in the form's 'load' function..... (i.e No Cursors),
| | (close em when frorm is closed)
| |
| | Form load time is quite acceptable...
| |
| | Question basically is: Why use Cursors??
| | (I will definitely Not use them in this case.......)
| |
| | Your comments would be appreciated.
| |
| | Derek
| | Australia.
| |
| |
|
|



Thu, 06 Mar 2003 03:00:00 GMT  
 Help with-> Form Design Issues
Cindy,

You are right.  It's just in case.
I'll leave the habit (for the time being I guess)
---------------------------------

| Gregory,
|
| Your SELECT 0 | CREATE CURSOR is probably one of those "just to make sure"
| habits, but the docs on CREATE CURSOR say "The temporary table is opened
in
| the lowest available work area..." so the SELECT 0 is not necessary.
|
| Saves a whole line of code!  ;-)
|



Thu, 06 Mar 2003 03:00:00 GMT  
 Help with-> Form Design Issues

Thank you Anders,
This makes all the difference......
setting NoDataOnLoad makes the 'load' time acceptable!
I appreciate your practical help.
Thank you,
Derek.


Quote:
> Hi
> You can improve loadtime by marking the cursors object property
> NoDataOnLoad, same as USE .. NODATA, and then  in the case of
paqrameterized
> views REQUERY('viewname') when a filter variable value has been specified
by
> the user. That's standard practice in the case of views. You can also let
> some pages of a pageframe handle thei own data in the UIEnable the first
> time the page is accessed. Someone has written a PD program to convert DE
> information to a  program to be run in the forms load.
> -Anders



> > Hi All,

> > I am a newbie (6 weeks with foxpro, but 15+ years as {*filter*}
programmer)

> > My questions are primarily aimed toward  "app design" issues:-

> > Advice wanted on 'Cursor' issues..

> > When designing a form, one can add 'cursors' to the dataenvironment.
> > (which is great cos, file handling is virtually automatic etc)

> > However, the Form "load time" is unacceptable!
> > (i.e. the time taken to open the form when 3 cursors are
> > attached is too slow (for a commercial product)....

> > If the regular approach is taken i.e....
> > Open the 3 files in the form's 'load' function..... (i.e No Cursors),
> > (close em when frorm is closed)

> > Form load time is quite acceptable...

> > Question basically is: Why use Cursors??
> > (I will definitely Not use them in this case.......)

> > Your comments would be appreciated.

> > Derek
> > Australia.



Fri, 07 Mar 2003 08:19:02 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. --------<<<<<<MONEY>>>>>>--------- id 4685

2. OO-Analysis and Design issues in VFP

3. VFP and Remote data - design issues

4. Help Needed with VFP forms, design question

5. Help with VFP Forms, design question.

6. Help - form design.

7. Form Design Options - Help ??

8. Compatability issues for vfp6 -> vfp8

9. REPORT FORM PROMPT ->->-> HELP!!!

10. >>>> Help needed: uploading bar-delimited("|") ascii file

11. *** COPIED FROM: >>>foxusergroup/problems 1757 dgraya(1325)9Sep95 01:37m

12. *** COPIED FROM: >>>Usenet/comp.databases 25688 codeman@cix.co(514)31Jul95 16:28

 

 
Powered by phpBB® Forum Software