Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sleep()

0 views
Skip to first unread message

Richard Carter

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to

matthew (faulc...@1stsrce.com) wrote:
: After using a query to update a table, I want the tableframe displaying the
: table to go to the first record. I do this with the command

: ...build and execute query
: tableFrameObject.home()

: When I do this I get an error message in the status box saying that the command
: is invalid during a refresh.
: To avoid this, I added sleep(100)

: ...build and execute query
: sleep(100)
: tableFrameobject.home()

: This works, the tableframe displays the first record at the top. However, it
: makes the whole screen flash white. I am using Paradox 7 in Windows 3.11.

: Any ideas on how I can avoid this white flash? I have tried using
: delayscreenupdates, but to no avial.

How about trying something like this (please check syntax;
I haven't tried it myself):

try
tableframeobject.home()
onFail
reTry
endTry

If this works, it should avoid the potential problem if your
program failing because it is being run from another computer
where it would need a different sleep() value to work correctly.
--
============================================================
Rick Carter cart...@email.uc.edu rca...@tso.cin.ix.net
============================================================

Mike Delaney

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to

I have used forceRefesh() in the past and it seemed to work okay

--
_________________________________
MDEL...@SierraMicro.Com
President
sierramicro

Colin Bridgewater

unread,
Mar 28, 1998, 3:00:00 AM3/28/98
to
I think that to get round the error, it is necessary to wait until the refresh of
the tableframe has happened (hence the error message). Your sleep(100) achieves
this, but waits too long, maybe sleep() would be sufficient.

Another alternative would be to do the home() after all outstanding events have
been processed. To achieve this, you can use postaction which puts the message at
the end of the queue. So try:
tabeFrameObject.postAction(DataBegin)

vcard.vcf

Sundial Services

unread,
Mar 31, 1998, 3:00:00 AM3/31/98
to

In article <6foc54$c...@drn.newsguy.com> matthew <faulc...@1stsrce.NOSPAM.com> writes:

>Your suggestion:
>> tabeFrameObject.postAction(DataBegin)
>Works perfectly!!! The screen doesn't blank out and it updates correctly
>regardless of whether it is running on a slow or fast maching.


I have found that in quite a number of places a "sleep(100)" statement is just
the right kind of grease to get things running smoothly again. Even in 32-bit
mode, this practice of giving long-running routines an =explicit= opportunity
to process outstanding Windows messages seems to make "those weird things that
happen" ... happen a lot less often.

"Sleep()" with no parameters apparently processes only one Windows message;
not terribly useful. It doesn't take a very large "Sleep()" value to assure
that all outstanding messages get processed, but it does seem to make a
difference that some number is included.


0 new messages