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

WAIT without window

625 views
Skip to first unread message

Herkus

unread,
Nov 29, 2007, 6:11:45 PM11/29/07
to
Hi all!
I want to suspend my code execution for a few seconds. WAIT TIMEOUT
ntime would be perfect, but in background it displays 'Press any key to
continue...'. Can I somehow disable that text? I dont want to see any
window also..

Fred Taylor

unread,
Nov 29, 2007, 8:04:55 PM11/29/07
to
WAIT WINDOW "" TIMEOUT 5

--
Fred
Microsoft Visual FoxPro MVP


"Herkus" <a...@b.com> wrote in message
news:ecZo30tM...@TK2MSFTNGP02.phx.gbl...

Stefan Wuebbe

unread,
Nov 30, 2007, 1:48:27 AM11/30/07
to

"Herkus" <a...@b.com> schrieb im Newsbeitrag
news:ecZo30tM...@TK2MSFTNGP02.phx.gbl...

You can also use the native Sleep() API function.
Declare integer Sleep in win32api integer
nMilliSeconds=1000
Sleep(nMilliSeconds)


hth
-Stefan

--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------


glene77is

unread,
Dec 2, 2007, 10:28:59 AM12/2/07
to

Herkus,

***

Note that you are specifying that you are waiting for a KEY press to
continue.

*****************************************************************************************
Try this example from the VFP Help.

CHRSAW( ) Function Example

In the following example, the system displays a window containing
input fields created with @ ... GET commands, and waits 5 seconds for
keyboard input. If a key isn't pressed in this time period, CHRSAW( )
returns false (.F.) and the program terminates.

SET TALK OFF
DEFINE WINDOW wEnter FROM 7,10 to 13,70 PANEL
ACTIVATE WINDOW wEnter
@ 1,3 SAY 'Customer: ' GET gcCustomer DEFAULT SPACE(40)
@ 3,3 SAY 'Address: ' GET gcAddress DEFAULT SPACE(40)
WAIT WINDOW 'Waiting for input' NOWAIT
IF NOT CHRSAW(5)
DEACTIVATE WINDOW wEnter
CLEAR GETS
ELSE
READ
DEACTIVATE WINDOW wEnter
ENDIF
RELEASE WINDOW wEnter
WAIT
CLEAR

***
*****************************************************************************************

Try a simple "Wait" check the VFP Help.
"Specifies a custom message to display. If you omit cMessageText,
Visual FoxPro displays the default message. If cMessageText is an
empty string (""), a message isn't displayed and Visual FoxPro waits
until a key is pressed before continuing program execution."

WAIT WINDOW ""
IF NOT CHRSAW()
DEACTIVATE WINDOW wEnter
CLEAR GETS
ELSE
READ
DEACTIVATE WINDOW wEnter
ENDIF
RELEASE WINDOW wEnter

I just tested it, and there will be a minimal window, which cannot be
placed off the form, and not behind anything. Maybe you could have a
little commandbutton, same size as the little wait window, then you
could overlay on on the other, the user not seeing anything
different. So play with it.

*****************************************************************************************

Note that you are specifying that you are waiting for a KEY press to
continue.

I've thought about setting focus to an invisible cmdSetFocus
button,which should hide the cursor.

call the cmdSetFocus.click() with the ChrSaw() function inside it.

=thisform.cmdSetFocus.click()

*(: thisform.cmdSetFocus.Click()
*- ChrSaw() requires a KEY entry to exit this loop.
do while NOT CHRSAW()
*- comment this testing 'wait window', still works.
wait window 'not ChrSaw() ' nowait
enddo

play with it.

*****************************************************************************************
***


***

good luck,
Glen Ellis, Memphis, TN, www.GeoCities.Com/glene77is

Carsten Bonde

unread,
Dec 4, 2007, 7:22:20 AM12/4/07
to
Herkules,

Inkey(2)

Waits for 2 seconds.

--
Cheers
Carsten
_______________________________

"Herkus" <a...@b.com> schrieb im Newsbeitrag
news:ecZo30tM...@TK2MSFTNGP02.phx.gbl...

0 new messages