Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can we have the F10 key back?
Message
De
28/04/1999 23:56:41
 
 
À
28/04/1999 23:29:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00212857
Message ID:
00213304
Vues:
36
>>Well it works. I created a method in my app called goApp.DoSave() which calls _screen.ActiveForm.save(). Then I just had to add the line:
>>
>>ON KEY LABEL F10 this.DoSave()
>
>Careful there...
>
>VFP let you use THIS in an OKL?

Good catch. Actually I lied. The code was:

ON KEY LABEL F10 goApp.DoSave()


This code is part of the init method of my app, so normally referring to goApp would be invalid since it doesn't exist until Init() finishes suscessfully. In this case it the (only) right thing to do and works fine as long as the user doesn't press the F10 key during instantiation. I suppose I could put this line right at the end of init to reduce that possibility.

I've appended the DoSave method in case anyone is interested.

Peter





***********************************************************************
* METHOD MassOne.DoSave
***********************************************************************
* Parent(base):
* Purpose.....: Execute the Save button on the active form.
* Parameters..:
* Returns.....:
* Created.....: 1999.04.28
* History.....:
**********************************************************************

local llSaveMethod

llSaveMethod = .f.

if type("_Screen.ActiveForm") = "O"
llSaveMethod= pemstatus(_Screen.ActiveForm,"Save",5)
endif

if llSaveMethod
_Screen.ActiveForm.Save()
else
Msg_RS(".")
endif

return .t.

Peter Robinson ** Rodes Design ** Virginia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform