Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Empty object for data fields
Message
From
03/04/2008 14:47:14
 
 
To
03/04/2008 14:32:33
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01307968
Message ID:
01307977
Views:
12
>Hello,
>
>When dealing with data objects, that are created like
>
SCATTER NAME oDataObject
>how can I add funtionality to that object, like
>
oDataObject.ADDPROPERTY("NewField")
>Or, in other words, how can I create a data object like the above without the SCATTER NAME command?

My Parameterx class automatically adds the necessary Addproperty() line if you set a property which does not exist.
*How to use the class:
Public oData
oData=CreateObject('parameterX')
oData.MyVar1=1
oData.MyVar2='some text'
?oData.Myvar1
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
Next
Reply
Map
View

Click here to load this message in the networking platform