VFP 9: Function Keys

This is a discussion on VFP 9: Function Keys within the xbase forums in Other Databases category; I have a function key setup that I use in development. Some of the keys I do not use that much. It would be handy to be able to press, say , and get a listing of the function key assignments. I can not see anything for doing this. It appears that the only way to get this is to parse the output of list status. This is less than optimal. Am I overlooking something? In searching, I see what appears to be a bug with fkmax(). It appears to return a value that is too high by one. The labelling ...

Go Back   Database Forum > Other Databases > xbase

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-20-2008, 09:30 PM
Default VFP 9: Function Keys

I have a function key setup that I use in development. Some of
the keys I do not use that much. It would be handy to be able to
press, say , and get a listing of the function key assignments.

I can not see anything for doing this. It appears that the only
way to get this is to parse the output of list status. This is less
than optimal.

Am I overlooking something?

In searching, I see what appears to be a bug with fkmax(). It
appears to return a value that is too high by one. The labelling
starts with (which is fklabel(1)). fklabel(fkmax()) returns an
empty string. This is the case with both settings of set compatible.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
Reply With Quote
  #2  
Old 07-20-2008, 10:22 PM
Default Re: VFP 9: Function Keys

Gene,

It's not a bug but documented behavior. According to VFP help for
FKLABEL() function, "The value of nFunctionKeyNumber should be from 0
through the number of function keys minus 1"

Would following work for you?

FOR i=1 TO FKMAX()
? FKLABEL(i-1), ON("Key", FKLABEL(i-1))
ENDFOR


--
--sb--

VFP MVP

Wirchenko wrote:
> I have a function key setup that I use in development. Some of
> the keys I do not use that much. It would be handy to be able to
> press, say , and get a listing of the function key assignments.
>
> I can not see anything for doing this. It appears that the only
> way to get this is to parse the output of list status. This is less
> than optimal.
>
> Am I overlooking something?
>
> In searching, I see what appears to be a bug with fkmax(). It
> appears to return a value that is too high by one. The labelling
> starts with (which is fklabel(1)). fklabel(fkmax()) returns an
> empty string. This is the case with both settings of set compatible.
>
> Sincerely,
>
> Gene Wirchenko
>
> Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.

Reply With Quote
  #3  
Old 07-21-2008, 05:57 AM
Default Re: VFP 9: Function Keys

Hi Gene,

> get a listing of the function key assignments.


The first question here would be what kind of key assignment are you talking
about. In VFP you can use function keys with ON KEY LABEL and with macros.

--
Christof


Reply With Quote
  #4  
Old 07-21-2008, 09:21 PM
Default Re: VFP 9: Function Keys

"Christof Wollenhaupt"
wrote:

>> get a listing of the function key assignments.

>
>The first question here would be what kind of key assignment are you talking
>about. In VFP you can use function keys with ON KEY LABEL and with macros.


OKL.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
Reply With Quote
  #5  
Old 07-21-2008, 09:24 PM
Default Re: VFP 9: Function Keys

Sergey Berezniker wrote:

>It's not a bug but documented behavior. According to VFP help for
>FKLABEL() function, "The value of nFunctionKeyNumber should be from 0
>through the number of function keys minus 1"


I see that NOW. I went by the example code which loops from 1 to
fkmax()!

[snip]

Sincerelky,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
Reply With Quote
  #6  
Old 07-22-2008, 01:44 AM
Default Re: VFP 9: Function Keys

Hi Gene,

for OKL you can fill an array with all function key labels (F1-F12) in
combination with all qualifiers (Shift, Ctrl, Alt) and then loop through
this list. If ON("Key",qualifier+"+F"+TRANS(n)) returns anything, the key
has an assignment. The return value is your code.

There is no function that would return a list with just assigned ON KEY
LABEL, you need to query VFP for every possible combination.

--
Christof


Reply With Quote
  #7  
Old 07-22-2008, 03:07 PM
Default Re: VFP 9: Function Keys

"Christof Wollenhaupt"
wrote:

>for OKL you can fill an array with all function key labels (F1-F12) in
>combination with all qualifiers (Shift, Ctrl, Alt) and then loop through
>this list. If ON("Key",qualifier+"+F"+TRANS(n)) returns anything, the key
>has an assignment. The return value is your code.


I forgot that there is an on(). Thank you.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 02:36 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.