Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public variables versus cursor
Message
De
30/11/2008 14:38:20
 
 
À
30/11/2008 11:38:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01364711
Message ID:
01364729
Vues:
36
This message has been marked as the solution to the initial question of the thread.
>Hi.
>I thing that I've read here, at UT, that is better not to use Public Variables
>because they can be easily overwritten. So my question is:
>Should I create a cursor with fields to store everything I need through my
>application?
>Thanks in advance!

I use an object to store all my variables.
oStorage=CreateObject('parameterX')
oStorage.nVar1=10
oStorage.lVar1=.T.
oStorage.cVar1='aaa'
oStorage..cVar2='hello'
?oStoage.nVar1

define class ParameterX as custom
  function This_Access(tcMember)
    if type('This.' + tcMember) = 'U'
      This.AddProperty(tcMember)
    endif
    return This
  EndFunc 
  function AddVar(tcMember,tcData)
      AddProperty(this,tcMember,tcData)
    return This
  endfunc
EndDefine
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform