Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making a really good main program.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00496424
Message ID:
00497933
Vues:
20
>Thanks George, that´s exactly I want to do, but I don´t know how.
>I wonder if you explain me to do it, or post some example.

Basically all it is is a object that sets and restores the environment. Simple example, using the TALK setting might look like this.
CLEAR
? SET('TALK')
oEnvirn = CREATEOBJECT('EnvirnomentSets')
? SET('TALK')
oEnvirn.RestoreEnvironment
? SET('TALK')
oEnvirn.SetEnvironment
? SET('TALK')
oEnvirn = NULL
? SET('TALK')

DEFINE CLASS EnvirnomentSets AS CUSTOM

  cTalkSetting = ""
  
  PROCEDURE Init
    
    WITH This
      .cTalkSetting = SET('TALK')
      .SetEnvironment
    ENDWITH
  ENDPROC
  
  PROCEDURE SetEnvironment
    
    SET TALK ON
    RETURN
  ENDPROC
  
  PROCEDURE RestoreEnvironment
  
    LOCAL lcsetting
    lcsetting = This.cTalkSetting
    SET TALK &lcsetting
    RETURN
  ENDPROC
  
  PROCEDURE Destroy
    
    This.RestoreEnvironment
    RETURN
  ENDPROC
ENDDEFINE
Now, in real-life, you'd probably change the talk setting to OFF. In my development environment, however, it's OFF so that's why I set it ON.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform