Hello Frank and Tracy,

Thanks so much for the help, I tried to macro the variable, never thought to
macro the entire command.

Everything is working great and it is Friday ... Life is Good.

This List is the BEST !!

TGIF

 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Tracy Pearson
Sent: Friday, July 06, 2012 3:37 PM
To: [email protected]
Subject: RE: ON KEY LABEL

Frank Cazabon wrote on 2012-07-06: 
>  Hi Kent,
>  
>  I'm not sure what the actual problem is (I would guess that you need 
> to  build up a string of the command you want assigned to the hotkey 
> and  then use macro substitution to put it in effect) , but it would 
> be much  safer to program this in the KeyPress() of the form (of 
> course assuming  you are using VFP and that there is a form active).
>  
>  Frank.
>  
>  Frank Cazabon
>  
>  On 06/07/2012 03:09 PM, Kent Belan wrote:
>  Hello,
>  
>  I am trying to build a custom menu with use defined hotkeys.
>  
>  So I have a cursor with the menu options and the a hotkey number, and
report
>  number
>  
>  The first report is assigned F4, second F5 and so on. This is done be 
> the  end user.
>  
>  I loop thru the cursor and am trying to assign the hotkeys, but 
> having  trouble
>  
>  Select hotkeys
>  Scan
>>     lcHotkey = 'F' + ltrim(str(hotkeys.keynum,2))
>>     
>>     on key label (lcHotKey) thisform.RunReport(hotkeys.reportnum)
>> Endscan
>> 
>> The problem is when F4 is hit it gives and error "reportnum not found"
>> 
>> If I put the correct report number it works fine:
>> On key label (lcHotkey) thisform.RunReport(13)  && This works fine
>> 
>> Any ideas on how I can get the on key label command to work with the 
>> variable ?

Kent,

The ON KEY LABEL stores the command. It evaluates the command at the time it
is called.

I believe you need to build the ON KEY LABEL command as a string, then Macro
Substitute it.

Cmd = "on key label " + lcHotKey + " thisform.runreport(" +
transform(hotkeys.reportnum) + ")"
&cmd


Tracy Pearson
PowerChurch Software


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/9D439350088845B0B7B6BABF6AB15DB3@LaptopW7
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to