Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Close any open form before exit
Message
De
15/06/2004 14:59:41
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/06/2004 13:21:50
Sammy Derban
Ghana Telecom
Accra, Ghana
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00913951
Message ID:
00914007
Vues:
21
>You guessed right. What is an Appication object?
>I want to try out yours too.
>Micheal's suggestion was quite simple though.
>TIA

Perhaps I should ask first, do you know what a class or an object is?

An application object is simply an object (based on a class) that stores central information about your application, and where you define methods which are relevant for the application in general.

Some of the tasks which you might want to have an application object handle include:

  • User login.
  • Keep track of open forms (your question).
  • On login, keep track of open toolbars; close them; re-open them when exiting the application (this is for the benefit of the developer, not the end-user).
  • Keep track of settings (SET ...), and restore them on application exit (again, this is for the benefit of the developer).

    An application class would be defined in a class library.

    It would be invoked in your main program:
    goProgram = CreateObject("cApplication") (if you called your class cApplication).
    You can access its methods and properties just like you access any other objects:
    ? goProgram.cLoginName
    You would open forms with a special method:
    goProgram.OpenForm("MyForm")
    This method would add the form to an array property of the application object.

    HTH,

    Hilmar.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform