Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Paradox > Re: Why the del...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 10 Topic 1337 of 1428
Post > Topic >>

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

by Mark Bannister <markRemove@[EMAIL PROTECTED] > Mar 7, 2008 at 08:24 AM

For Lurkers :
There are some BIG caveats when using sleep.  As everyone who has used 
the web.ocx  has learned sleep not only yields to Windows but also to 
Paradox itself.  When using sleep other paradox events/code can start in 
the middle of your running code. This includes user actions such as 
clicking a button.
This usually is not an issue but if you are working with tcursors or 
setting application global variables you may find the tcursors are 
locked or changed or perhaps your system settings have been affected 
(for instance: ignorecaseinstringcompares).

Events firing in the midst of your code is more prominent when your code 
is running from libraries or other forms.  Generally I have seen that 
paradox acts more like a multithreaded program when to different forms 
or libraries interact with one another.  You can use this for your 
advantage.  For instance if you want to create a pause button for a long 
process, placing a Pause button on the same form will not work (not 
consistently anyway) but, opening another form with the pause button on 
it will.

While I'm on this pedantic lecture.....
Related to this is things I have learned recently about 
delayscreenupdates(Yes|No).  Delaying screen updates not only delays the 
screen display, it actually delays the events that would occur with the 
screen changes.  So things like newvalue  are actually delayed.  Let's 
say your user has several forms open relating to a company address.  One 
or two of those forms is using the newvalue event to kick off some 
program logic in a library somewhere.  Now you have other code working 
with a tcursor on the address table and you make changes and post a 
record in a scan.  If delayscreenupdates is not on then the code fired 
by the newvalue event on the form may fire and could conceivably change 
some record in the tcursor you are scanning.  Or perhaps more 
insidiously change something like ignorecaseinlocate or blankAsZero in 
the middle of your code.


So the lesson is, if you use sleep() be aware that it may cause odd and 
very hard to reproduce problems (as they could be dependent on a 
combination of forms being open).

Lesson two:  I would suggest *always* turning on delayscreenupdates 
during code execution.  It makes code run much faster and predictably if 
there are forms open.


-- 
Mark B
 




 10 Posts in Topic:
Why the delay to close()...?
Kenneth <usenet@[EMAIL  2008-03-06 12:59:21 
Re: Why the delay to close()...?
Dennis Santoro <RDAPre  2008-03-06 13:11:33 
Re: Why the delay to close()...?
"Tony McGuire"   2008-03-06 11:15:23 
Re: Why the delay to close()...?
Kenneth <usenet@[EMAIL  2008-03-06 13:55:53 
Re: Why the delay to close()...?
"Jim Moseley" &  2008-03-06 15:14:08 
Re: Why the delay to close()...?
Kenneth <usenet@[EMAIL  2008-03-06 16:58:07 
Re: Why the delay to close()...?
Sundial Services <info  2008-03-06 20:49:27 
Re: Why the delay to close()...?
Sundial Services <info  2008-03-06 22:31:33 
Re: Why the delay to close()...?
Kenneth <usenet@[EMAIL  2008-03-07 07:32:01 
Re: Why the delay to close()...?
Mark Bannister <markRe  2008-03-07 08:24:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 22:05:06 CST 2008.