Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying PEMs
Message
From
19/07/2002 13:12:57
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Copying PEMs
Miscellaneous
Thread ID:
00680539
Message ID:
00680539
Views:
60
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 Morris
Next
Reply
Map
View

Click here to load this message in the networking platform