Go to Sleep

Franlkin makes a note on how to go to
Franklin Sleep en VFP (Sleep in VFP)

It brings up a very important reminder of working with DLLs.

The code was this:
Declare integer Sleep in “kernel32” Long dwMilliseconds

Sleep(200)

The trick? VFP Developers get so used to being case-insensitive if you define it as

Declare integer sleep …

It won’t work. API calls are case-sensitive.

It was a handy post too – I was just getting ready to use

INKEY(5,”H”)

What’s that last “H” do? It hides the cursor.

A lot of older code coming from DOS days just used to say INKEY(2) – and you would see a cursor sitting there on the screen. UGLY!

With INKEY, you can set the second parameter to “S” – to show the cursor, H to hide it, M to wait for a mouseclick or E to expand a keyboard macro.

But with the Sleep call, you don’t need to worry about it – and rely on the basic Windows API call.

Thanks Franklin!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Contact

48 Stonemeadow Drive
Kanata, Ontario K2M2K2

+1 613-851-4496 Contact Us

Connect

Newsletter

Coming Soon