Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public variables versus cursor
Message
From
30/11/2008 14:38:20
 
 
To
30/11/2008 11:38:20
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01364711
Message ID:
01364729
Views:
37
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
Previous
Reply
Map
View

Click here to load this message in the networking platform