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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Foxpro conversion error get_last_key

Status
Not open for further replies.

rep98

MIS
Mar 8, 2006
2
PR
I am trying to convert an application that I created with foxpro dos v2.5. to visual foxpro 9. I created a menu, and from there I'm calling my progs but some of them are giving this error:File 'get_last_key.prg' does not exist. Here is a sample of my code:
ACTIVATE WINDOW NOSHOW paCientes
SHOW WINDOW paCientes
ON KEY
ON KEY LABEL F4 DO Get_Last_Key
ON KEY LABEL F5 DO Get_Last_Key
ON KEY LABEL F6 DO Get_Last_Key
ON KEY LABEL F7 DO Get_Last_Key
ON KEY LABEL F8 DO Get_Last_Key
ON KEY LABEL F9 DO Get_Last_Key
ON KEY LABEL ESC DO Get_Last_Key
ON KEY LABEL F10 DO Get_Last_Key
SELECT 1
BROWSE FIELDS nuM_teleph : 8 :R :H = 'Telefono', peTname : 12 :R :H = ;
' Nombre', esPecie : 7 :R :H = 'Especie', adMindate : 10 :R :H = ;
' Admicion', esTimado : 8 :R :H = 'Estimado', dePosito : 8 :R :H = ;
'Deposito', faCtbal : 8 :R :H = ' Cargos ', muLtialta : 4 :p = ;
'!' :H = 'Tipo' :V = IIF(muLtialta='X' .OR. muLtialta='C' .OR. ;
muLtialta=' ', .T., .F.) :E = ;
'Oprima X, C ó deje el campo en blanco...' FREEZE muLtialta ;
NOMENU NOAPPEND NOCLEAR IN paCientes COLOR BG+/RB,GR+/RB,GR+/W,,,, ;
GR+/RB
ACTIVATE SCREEN
ON KEY LABEL F4
ON KEY LABEL F5
ON KEY LABEL F6
ON KEY LABEL F7
ON KEY LABEL F8
ON KEY LABEL F9
ON KEY LABEL F10
ON KEY LABEL ESC
DO CASE
CASE lsTkey=-3
DO mnG_estima
Please let me know what I'll have to do to make it work with visual foxpro 9. Thank You
bertle
 

Hi Bertle,

This is probably a pathing problem. At the time that the user hits the relevant function key, Get_Last_Key.PRG is no longer in the search path, hence the message.

Alternatively, Get_Last_Key is a function in another PRG, and that PRG is no longer open.

Either way, it highlights the danger of doing menus in this way. Using On Key Label is OK in FoxPro for DOS, but is not recommended for VFP. You'll do much better if you create a menu in the VFP menu designer.

When you do that, you can make each command DO a function or procedure, just as you are doing now. Just make sure to put all those procedure in a single file, which is always open (e.g. via SET PROCEDURE). Or, put each one in its own PRG, and make sure the PRG is always in the default directory or the search path.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top