Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solving numeric keypad woes.

Status
Not open for further replies.

mmerlinn

Programmer
May 20, 2005
748
US
Recently while using FoxPro, my numeric keypad quit working. All keys on the main keyboard, including the number keys, continued working as normal while using FoxPro.

The thing that drove me crazy for two days is that the keypad would work normally in all programs EXCEPT FOXPRO. In FP, the keypad worked as if the number lock was set to 'off', even when it was set to 'on'. And it did not matter whether I was in the command window, an editing window, or even running one of my FP applications. And the same exact applications would run normally on another system, even though the application was residing on a central server from which both machines ran the same application.

Eventually, I narrowed the problem down to the copy of FP on the one machine, but I could not find ANY settings anywhere that could be accessed which would solve the problem. So, before I reloaded a fresh copy of FP, I checked the preferences folder and found a FoxPro Settings file in that folder.

I opened the Settings file in SimpleText and found number lock was set to '0'. When I opened an older copy of the Settings file, number lock was set to '1'. So, I changed the '0' to a '1' in the latest file, saved it, and restarted FoxPro. PROBLEM SOLVED!

What I do not understand is HOW the number lock setting was changed in the first place. Neither can I find anywhere in FP where it can be set or unset either on purpose or by accident. Regardless, I am VERY happy to have the numeric keypad working properly again.

If perchance your numeric keypad quits working in FoxPro, verify that number lock in the FoxPro Settings preference file is set to '1'. If it is set to anything else, change it and see if that solves your problem. As usual, ALWAYS, ALWAYS, make a copy of the file BEFORE you make any changes just so you don't accidentally make things worse.

Using FP 2.6 on a Mac.

mmerlinn


Poor people do not hire employees. If you soak the rich, who are you going to work for?

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Raymond
 
Maybe the NUMLOCK() function was involved.

Tamar
 
FP/Mac 2.x has always had a love/hate relationship with Mac hardware.

Heck, on a French keyboard layout using French MacOS you couldn't type numbers! <g> If that preferences file was ever copied from a Macbook, it may not have *had* a numeric keypad and that may have caused -- as they say -- unpredictable results.

<shrug>

Glad you found it!
 
Tamar, you misunderstand. The FoxPro Settings file sets the DEFAULT behavior of FoxPro at startup regardless of whether I open the command window, open a project file, or run a FoxPro application.

For example:

I turn on the computer.
I start FoxPro (NOT a FoxPro application).
I open the command window.
I type a number on the numeric keypad.
Nothing.

So, no, there is no connection to NUMLOCK().

Just to be sure, I experimented with NUMLOCK(). Yes, it toggles the output of the numeric keypad, BUT IT NEVER TOGGLES THE NUMBER LOCK SETTING IN THE FOXPRO SETTINGS PREFERENCE FILE.

So, again, there is no connection to NUMLOCK().

Finally, I never knew about NUMLOCK() until your post, so have never used it in any program that I have ever written. Now that I know about it, there are a few places that I need to insert it in my code and will do so as I update that code. Many thanks for bringing it to my attention.

*****

Dan, FoxPro on this machine is an original installation directly off of the original 3.5" floppies over 10 years ago. Until now I never even knew about the FoxPro Settings file and have never had a problem with it before.

Good thing I never needed to use French FoxPro. I could never survive without numbers.

mmerlinn


Poor people do not hire employees. If you soak the rich, who are you going to work for?

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Raymond
 
can you try setting back to original bad value to numlock in the config file and try set/reset with numlock() function. what is the behaviour ?


nasib
 
Nasib, NUMLOCK() has no effect on the FoxPro Settings file whatsoever no matter what value the number lock value is set to in the file. I tried every combination when I was experimenting just to verify what NUMLOCK() does or does not do with the file. Result? NUMLOCK() has NO effect on the file whatsoever.

BTW, the config file is a different file that I never bothered to test against since it was not the problem. NUMLOCK() may or may not affect the config file.

mmerlinn


Poor people do not hire employees. If you soak the rich, who are you going to work for?

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Raymond
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top