>*************************************************************************** >**&RS PROCEDURE CopyClass_RS >*************************************************************************** >**Purpose.....: Copy a class from one VCX to the same or another VCX >**Parameters..: tcClassName1 -- the class to copy >** tcClassLib1 -- the library containing the class >** tcClassName2 -- the new name of the class if different >** tcClassLib2 -- the new class library (VCX) if different >**Returns.....: true if successfull >**Notes.......: >**Example.....: >**Project.....: Rodes Design Utilities >**Authors.....: Peter Robinson & Dale Strickler >**Copyright...: (c) Rodes Design 2006 >**Created.....: &&RS 2006.05.27 >**History.....: >*************************************************************************** >lparameter tcClassName1, tcClassLib1, tcClassName2, tcClassLib2 > >local tcClassName1, tcClassName2 > >if not type("tcClassName1") == "C" > Msg_RS("<Invalid parameter> 1") > return .f. >else > tcClassName1 = lower(alltrim(tcClassName1)) >endif > >if not type("tcClassLib1") == "C" > Msg_RS("<Invalid parameter> 2") > return .f. >else > tcClassLib1 = lower(alltrim(tcClassLib1)) >endif > >if not type("tcClassName2") == "C" or empty(tcClassName2) > tcClassName2 = tcClassName1 >else > tcClassName2 = lower(alltrim(tcClassName2)) >endif > >if not type("tcClassLib2") == "C" or empty(tcClassLib2) or tcClassLib1 == tcClassLib2 > tcClassLib2 = "" >else > tcClassLib2 = alltrim(tcClassLib2) >endif > >if empty(tcClassLib2) > set safety off > delete file CopyClass_RS.vcx > delete file CopyClass_RS.vct > set safety on > tcClassLib2 = "CopyClass_RS" >endif > >add class &tcClassName1 of &tcClassLib1 to (tcClassLib2) > >if tcClassName2 <> tcClassName1 > rename class &tcClassName1 of (tcClassLib2) to &tcClassName2 >endif > >if tcClassLib2 = "CopyClass_RS" > add class &tcClassName2 of (tcClassLib2) to &tcClassLib1 > delete file "CopyClass_RS.vcx" > delete file "CopyClass_RS.vct" >endif >Peter, that is indeed, an excellent little utility. Thanks.