dbTalk Databases Forums  

Re: Why the delay to close()...?

comp.databases.paradox comp.databases.paradox


Discuss Re: Why the delay to close()...? in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 12:11 PM






Well, there are a bunch of potential issues. Since you might have the
form already open (I assume because of your attach) it will show up
faster if it is already open but you don't control the z order or even
do a bringtotop on the attach. For finding the record, if the field you
are searching on is a key field (probably should be a unique integer ID
for the person) then a qlocate will be faster as you will use the index.
If you bring the form to the top the delay in the other form close may
be irrelevant (and may be related to all sorts of things like code in
the close method, open tcursors you haven't cleaned up etc.) but if it
bothers you look at that sort of stuff and also consider doing a hide()
just before the close so you don't have to watch it close.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and
non-profits since 1982

Kenneth wrote:
Quote:
Howdy,

I have a form that is used for a particular search process.
It works fine, but with an odd delay.

Here's how it is used:

We enter on another form the criteria for a search of our
database. Those might be "Jones" (in the lastNameField) and
54321 (in the zipCodeField.)

Next, the form in question (called SEARCH.FDL) opens
displaying all the records that meet the criteria.

The user scrolls down to the person whose record they wish
to view, touches enter, and another form (called PEOPLE.FDL)
then searches for, and displays that individual's record.

And this is the odd behavior:

Almost without exception, when the user touches Enter, the
PEOPLE form is already open, and is visible beneath the
SEARCH form (but pointing to another record.)

Then, in about two seconds, the PEOPLE form moves to the
chosen record, but the SEARCH form remains open for another
five seconds or so.

Why might the SEARCH form take so long to close itself? (Or
might there be a way to see the PEOPLE form more quickly
while the SEARCH form takes whatever time it needs to
close?)

Here's the code on the SEARCH form that finds the proper
record:


method keyPhysical(var eventInfo KeyEvent)
var
People form
EndVar

if eventInfo.vCharCode()=VK_Return then
disableDefault
setMouseshape(mouseWait)
If people.attach("PeopleKS") then
People.num.Locate("num",num)
People.moveto()
else
People.Open("PeopleKS",winStyleDefault+winStyleHid den)
People.num.Locate("num",num)
People.bringToTop()
endif
self.close()
endIf
endMethod


Thanks for any suggestions,

Reply With Quote
  #2  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 12:11 PM






Well, there are a bunch of potential issues. Since you might have the
form already open (I assume because of your attach) it will show up
faster if it is already open but you don't control the z order or even
do a bringtotop on the attach. For finding the record, if the field you
are searching on is a key field (probably should be a unique integer ID
for the person) then a qlocate will be faster as you will use the index.
If you bring the form to the top the delay in the other form close may
be irrelevant (and may be related to all sorts of things like code in
the close method, open tcursors you haven't cleaned up etc.) but if it
bothers you look at that sort of stuff and also consider doing a hide()
just before the close so you don't have to watch it close.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and
non-profits since 1982

Kenneth wrote:
Quote:
Howdy,

I have a form that is used for a particular search process.
It works fine, but with an odd delay.

Here's how it is used:

We enter on another form the criteria for a search of our
database. Those might be "Jones" (in the lastNameField) and
54321 (in the zipCodeField.)

Next, the form in question (called SEARCH.FDL) opens
displaying all the records that meet the criteria.

The user scrolls down to the person whose record they wish
to view, touches enter, and another form (called PEOPLE.FDL)
then searches for, and displays that individual's record.

And this is the odd behavior:

Almost without exception, when the user touches Enter, the
PEOPLE form is already open, and is visible beneath the
SEARCH form (but pointing to another record.)

Then, in about two seconds, the PEOPLE form moves to the
chosen record, but the SEARCH form remains open for another
five seconds or so.

Why might the SEARCH form take so long to close itself? (Or
might there be a way to see the PEOPLE form more quickly
while the SEARCH form takes whatever time it needs to
close?)

Here's the code on the SEARCH form that finds the proper
record:


method keyPhysical(var eventInfo KeyEvent)
var
People form
EndVar

if eventInfo.vCharCode()=VK_Return then
disableDefault
setMouseshape(mouseWait)
If people.attach("PeopleKS") then
People.num.Locate("num",num)
People.moveto()
else
People.Open("PeopleKS",winStyleDefault+winStyleHid den)
People.num.Locate("num",num)
People.bringToTop()
endif
self.close()
endIf
endMethod


Thanks for any suggestions,

Reply With Quote
  #3  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 12:11 PM



Well, there are a bunch of potential issues. Since you might have the
form already open (I assume because of your attach) it will show up
faster if it is already open but you don't control the z order or even
do a bringtotop on the attach. For finding the record, if the field you
are searching on is a key field (probably should be a unique integer ID
for the person) then a qlocate will be faster as you will use the index.
If you bring the form to the top the delay in the other form close may
be irrelevant (and may be related to all sorts of things like code in
the close method, open tcursors you haven't cleaned up etc.) but if it
bothers you look at that sort of stuff and also consider doing a hide()
just before the close so you don't have to watch it close.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and
non-profits since 1982

Kenneth wrote:
Quote:
Howdy,

I have a form that is used for a particular search process.
It works fine, but with an odd delay.

Here's how it is used:

We enter on another form the criteria for a search of our
database. Those might be "Jones" (in the lastNameField) and
54321 (in the zipCodeField.)

Next, the form in question (called SEARCH.FDL) opens
displaying all the records that meet the criteria.

The user scrolls down to the person whose record they wish
to view, touches enter, and another form (called PEOPLE.FDL)
then searches for, and displays that individual's record.

And this is the odd behavior:

Almost without exception, when the user touches Enter, the
PEOPLE form is already open, and is visible beneath the
SEARCH form (but pointing to another record.)

Then, in about two seconds, the PEOPLE form moves to the
chosen record, but the SEARCH form remains open for another
five seconds or so.

Why might the SEARCH form take so long to close itself? (Or
might there be a way to see the PEOPLE form more quickly
while the SEARCH form takes whatever time it needs to
close?)

Here's the code on the SEARCH form that finds the proper
record:


method keyPhysical(var eventInfo KeyEvent)
var
People form
EndVar

if eventInfo.vCharCode()=VK_Return then
disableDefault
setMouseshape(mouseWait)
If people.attach("PeopleKS") then
People.num.Locate("num",num)
People.moveto()
else
People.Open("PeopleKS",winStyleDefault+winStyleHid den)
People.num.Locate("num",num)
People.bringToTop()
endif
self.close()
endIf
endMethod


Thanks for any suggestions,

Reply With Quote
  #4  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 12:11 PM



Well, there are a bunch of potential issues. Since you might have the
form already open (I assume because of your attach) it will show up
faster if it is already open but you don't control the z order or even
do a bringtotop on the attach. For finding the record, if the field you
are searching on is a key field (probably should be a unique integer ID
for the person) then a qlocate will be faster as you will use the index.
If you bring the form to the top the delay in the other form close may
be irrelevant (and may be related to all sorts of things like code in
the close method, open tcursors you haven't cleaned up etc.) but if it
bothers you look at that sort of stuff and also consider doing a hide()
just before the close so you don't have to watch it close.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and
non-profits since 1982

Kenneth wrote:
Quote:
Howdy,

I have a form that is used for a particular search process.
It works fine, but with an odd delay.

Here's how it is used:

We enter on another form the criteria for a search of our
database. Those might be "Jones" (in the lastNameField) and
54321 (in the zipCodeField.)

Next, the form in question (called SEARCH.FDL) opens
displaying all the records that meet the criteria.

The user scrolls down to the person whose record they wish
to view, touches enter, and another form (called PEOPLE.FDL)
then searches for, and displays that individual's record.

And this is the odd behavior:

Almost without exception, when the user touches Enter, the
PEOPLE form is already open, and is visible beneath the
SEARCH form (but pointing to another record.)

Then, in about two seconds, the PEOPLE form moves to the
chosen record, but the SEARCH form remains open for another
five seconds or so.

Why might the SEARCH form take so long to close itself? (Or
might there be a way to see the PEOPLE form more quickly
while the SEARCH form takes whatever time it needs to
close?)

Here's the code on the SEARCH form that finds the proper
record:


method keyPhysical(var eventInfo KeyEvent)
var
People form
EndVar

if eventInfo.vCharCode()=VK_Return then
disableDefault
setMouseshape(mouseWait)
If people.attach("PeopleKS") then
People.num.Locate("num",num)
People.moveto()
else
People.Open("PeopleKS",winStyleDefault+winStyleHid den)
People.num.Locate("num",num)
People.bringToTop()
endif
self.close()
endIf
endMethod


Thanks for any suggestions,

Reply With Quote
  #5  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 12:11 PM



Well, there are a bunch of potential issues. Since you might have the
form already open (I assume because of your attach) it will show up
faster if it is already open but you don't control the z order or even
do a bringtotop on the attach. For finding the record, if the field you
are searching on is a key field (probably should be a unique integer ID
for the person) then a qlocate will be faster as you will use the index.
If you bring the form to the top the delay in the other form close may
be irrelevant (and may be related to all sorts of things like code in
the close method, open tcursors you haven't cleaned up etc.) but if it
bothers you look at that sort of stuff and also consider doing a hide()
just before the close so you don't have to watch it close.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and
non-profits since 1982

Kenneth wrote:
Quote:
Howdy,

I have a form that is used for a particular search process.
It works fine, but with an odd delay.

Here's how it is used:

We enter on another form the criteria for a search of our
database. Those might be "Jones" (in the lastNameField) and
54321 (in the zipCodeField.)

Next, the form in question (called SEARCH.FDL) opens
displaying all the records that meet the criteria.

The user scrolls down to the person whose record they wish
to view, touches enter, and another form (called PEOPLE.FDL)
then searches for, and displays that individual's record.

And this is the odd behavior:

Almost without exception, when the user touches Enter, the
PEOPLE form is already open, and is visible beneath the
SEARCH form (but pointing to another record.)

Then, in about two seconds, the PEOPLE form moves to the
chosen record, but the SEARCH form remains open for another
five seconds or so.

Why might the SEARCH form take so long to close itself? (Or
might there be a way to see the PEOPLE form more quickly
while the SEARCH form takes whatever time it needs to
close?)

Here's the code on the SEARCH form that finds the proper
record:


method keyPhysical(var eventInfo KeyEvent)
var
People form
EndVar

if eventInfo.vCharCode()=VK_Return then
disableDefault
setMouseshape(mouseWait)
If people.attach("PeopleKS") then
People.num.Locate("num",num)
People.moveto()
else
People.Open("PeopleKS",winStyleDefault+winStyleHid den)
People.num.Locate("num",num)
People.bringToTop()
endif
self.close()
endIf
endMethod


Thanks for any suggestions,

Reply With Quote
  #6  
Old   
Tony McGuire
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 12:15 PM




hide() the original form, then open/search?

How about speeding everything up by creating a secondary index on the
'num' field? Then you could use qlocate - which is about 100 times
(or more) faster than locate?

The 'close()' statement doesn't get acted on until all other code has
completed.


--
------------------------------
Tony McGuire



Reply With Quote
  #7  
Old   
Tony McGuire
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 12:15 PM




hide() the original form, then open/search?

How about speeding everything up by creating a secondary index on the
'num' field? Then you could use qlocate - which is about 100 times
(or more) faster than locate?

The 'close()' statement doesn't get acted on until all other code has
completed.


--
------------------------------
Tony McGuire



Reply With Quote
  #8  
Old   
Jim Moseley
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 02:14 PM




Kenneth,

If your Search form has already found the row, why waste the effort of having
your People form locate() it again? Just attach a tcursor to your row and
resync the field, as in:

var
tc tcursor
ui UIObject
endVar

if eventInfo.vCharCode()=VK_Return then
disableDefault
setMouseshape(mouseWait)
If NOT people.attach("PeopleKS") then
People.Open("PeopleKS",winStyleDefault+winStyleHid den)
endif
ok = tc.attach(num)
if ok then
ok = ui.attach(People.num) ; or whatever your field is
endif
if ok then
ok = ui.resync(tc)
endif
if not ok then
errorShow()
endif
endif

HTH,
Jim Moseley

Reply With Quote
  #9  
Old   
Jim Moseley
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 02:14 PM




Kenneth,

If your Search form has already found the row, why waste the effort of having
your People form locate() it again? Just attach a tcursor to your row and
resync the field, as in:

var
tc tcursor
ui UIObject
endVar

if eventInfo.vCharCode()=VK_Return then
disableDefault
setMouseshape(mouseWait)
If NOT people.attach("PeopleKS") then
People.Open("PeopleKS",winStyleDefault+winStyleHid den)
endif
ok = tc.attach(num)
if ok then
ok = ui.attach(People.num) ; or whatever your field is
endif
if ok then
ok = ui.resync(tc)
endif
if not ok then
errorShow()
endif
endif

HTH,
Jim Moseley

Reply With Quote
  #10  
Old   
Jim Moseley
 
Posts: n/a

Default Re: Why the delay to close()...? - 03-06-2008 , 02:14 PM




Kenneth,

If your Search form has already found the row, why waste the effort of having
your People form locate() it again? Just attach a tcursor to your row and
resync the field, as in:

var
tc tcursor
ui UIObject
endVar

if eventInfo.vCharCode()=VK_Return then
disableDefault
setMouseshape(mouseWait)
If NOT people.attach("PeopleKS") then
People.Open("PeopleKS",winStyleDefault+winStyleHid den)
endif
ok = tc.attach(num)
if ok then
ok = ui.attach(People.num) ; or whatever your field is
endif
if ok then
ok = ui.resync(tc)
endif
if not ok then
errorShow()
endif
endif

HTH,
Jim Moseley

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.