Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass value of parameters from UI to BIZ to DA
Message
From
19/01/2008 15:30:55
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01283283
Message ID:
01283308
Views:
14
>>>The only way I see passing the values of from UI to BIZ to DA is by passing them as parameters when instantiating BIZ class and respectively DA class. But the number of this properties/parameters would be too many and kludgy. So I am looking for a better way.
>>
>>No, there's only one parameter - the object itself.
>>
>>You'll need something like this (in metacode):
>>
>>
*-- the new object's .init
>>lparameters toParent
>>n=amembers(aPr, toParent, "UC")
>>for i=1 to n
>>   lcProp=aPr[i]
>>   do case
>>      case inlist(lcProp, "name" ... and any other property we want to skip)
>>*-- do nothing
>>      case {any other exception}
>>*-- do nothing
>>      case pemstatus(this, lcProp, 5)
>>         this.addproperty(lcprop, getpem(toParent, lcProp))
>>   endcase
>>endfor
>>
>>Not eactly sure of the aPr array, may need to look at what exactly does aMembers do for various parameters - this is just to get you started, but shouldn't need much work.
>
>Dragan,
>
>I understand what you are suggesting. I think it should work.

Just a note: the .addproperty line is where it happens - and it will work regardless of the existence of the property in the new object. If it has the property, it will just set it; if it doesn't, it will create it, and no error either way.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform