Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying Methods From One Form to Another
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00649462
Message ID:
00649489
Views:
17
Charles,

Here's some code that might help.
lparameter lcFile, roRoot

if ( pcount() < 2 )
   Messagebox( "no parms" )
endif

use (lcFile) in 0 alias classlibin

select classlibin
scan
   if ( platform = "COMMENT" )
      loop
   endif
   loNode = roRoot.NewNode( classlibin.objname )
   with loNode
      .mcBaseClass  = classlibin.BaseClass
      .mcParentClass = classlibin.Class
      if ( .mcBaseClass == .mcParentClass )
         * derived from VFP BaseClass
         *.mcClassLoc will also be blank
      endif
      .mcClassLoc   = classlibin.Classloc
      if ( empty( .mcClassLoc ) )
         .mcClassLoc = lower( lcFile )
      endif
      .mcComment    = classlibin.Reserved7
      .mcMethods    = classlibin.Methods
      .mcProperties = classlibin.Properties
      if ( ! empty( classlibin.Reserved3 ) )
         .mnPEM = alines( laPEM, classlibin.Reserved3 )
         dimension .maPEM[.mnPEM,3]
      endif
      for i = 1 to .mnPEM
         j = at( " ", laPEM[i] )
         if ( j > 0 )
            .maPEM[i,2] = left( laPEM[i], j - 1 )
            .maPEM[i,3] = substr( laPEM[i], j + 1 )
         else
            .maPEM[i,2] = laPEM[i]
            .maPEM[i,3] = ""
         endif
         lcType = left( .maPEM[i,2], 1 )
         do case
            case ( lcType = "*" )
               .maPEM[i,1] = "method"
            case ( lcType = "^" )
               .maPEM[i,1] = "array property"
            otherwise
               .maPEM[i,1] = "property"
         endcase
         if ( .maPEM[i,1] != "property" )
            .maPEM[i,2] = substr( .maPEM[i,2], 2 )
         endif
      endfor
      n = alines( laProtectedHidden, classlibin.Protected )
      for i = 1 to n
         if( "^" $ laProtectedHidden[i] )
            lcVisibility = "hidden"
            laProtectedHidden[i] = chrtran( laProtectedHidden[i], "^", "" )
         else
            lcVisibility = "protected"
         endif
         for j = 1 to .mnPEM
            if ( "array" $ .maPEM[j,1] )
               llFound = ( laProtectedHidden[i] + "[" $ .maPEM[j,2] )
            else
               llFound = ( .maPEM[j,2] == laProtectedHidden[i] )
            endif
            if ( llFound )
               .maPEM[j,1] = lcVisibility + " " + .maPEM[j,1]
               exit
            endif
         endfor
      endfor
      for i = 1 to .mnPEM
         if ( ( "hidden" $ .maPEM[i,1] ) or ;
              ( "protected" $ .maPEM[i,1] ) )
            loop
         endif
         .maPEM[i,1] = "public " + .maPEM[i,1]
      endfor
   endwith
endscan

use in classlibin
>Thanks for your quick replies. Just one more question: Aren't there documentations on hacking the .SCX file or at least descriptions of each field in the .SCX file?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform