Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying PEMs
Message
From
19/07/2002 13:44:03
 
 
To
19/07/2002 13:30:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00680539
Message ID:
00680552
Views:
35
>>If I want to copy all the Non Default PEMs from one object to another, do I need to consider anything else?
>>
>>PROCEDURE Copy_Changed_PEMs(toSource,toDest)
>>  IF VARTYPE(toSource)<>'O' ;
>>      OR VARTYPE(toDest)<>'O'
>>    RETURN
>>  ENDIF
>>
>>  LOCAL laSource(1), lnRow, lcMember, lcPEM, lcExpression
>>  = AMEMBERS(laSource,toSource,1,'C+#')
>>  FOR lnRow = 1 TO ALEN(laSource,1)
>>    lcMember = laSource(lnRow,1)
>>    lcPEM = laSource(lnRow,2)
>>    DO CASE
>>      CASE lcPEM = 'Property'
>>        IF lcMember <> 'NAME'
>>          lcExpression = toSource.READEXPRESSION(lcMember)
>>          IF !EMPTY(lcExpression)
>>            toDest.WRITEEXPRESSION(lcMember,lcExpression)
>>          ELSE
>>            toDest.&lcMember = toSource.&lcMember
>>          ENDIF
>>        ENDIF
>>      CASE lcPEM = 'Method' ;
>>          OR lcPEM = 'Event'
>>        toDest.WRITEMETHOD(lcMember,toSource.READMETHOD(lcMember))
>>    ENDCASE
>>  ENDFOR
>>
>
>Bill,
>I don't remember if those amember() flags were doing this for you :
>Check if property is protected, readonly.
>
>Also as I can see you're using writemethod (designtime). Are objects from different class ? If not cloneobject might be easier.
>Cetin

Hi Cetin,
Thanks for reminding me of protected/hidden attributes.

Unfortunately, I am trying to copy an object from one form to another, so CloneObject won't work (it creates the new object in the same container). I think I have a corrupted form (it keeps having an intermittent error, and usually not the same error), so I'm trying to re-create the form by copying the objects from the old form to the new form. I've already tried cutting and pasting and the error went with it. I'm hoping that by using WRITEMETHOD, I'll lose the corruption.
Bill Morris
Previous
Reply
Map
View

Click here to load this message in the networking platform