Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quick way of coping class in the classlibrary
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01089745
Message ID:
01089765
Vues:
8
>Hi everybody,
>
>If I need to copy a class in the classlibrary under different name, I visually add it to another library, rename there, move back to the original library, then delete from the other library. Is there a way to do it an easier way? Something like
>
>copy class myClass to myNewClass in classlibrary MyClassLib.
>
>Thanks in advance.
>
>Ok, I started to write this function. Now I need an ability to determine classlib based on the class.
function CopyVisualClass
lparameters tcClassName, tcNewClassName, tcClassLib

if vartype(m.tcClassName) <>"C" ;
		or vartype(m.tcNewClassName) <> "C" ;
		or vartype(m.tcClassLib) <> "C"
	return
endif
LOCAL loException
try
	add class (m.tcClassName) to Utilities\TempClassLib overwrite

	rename class (m.tcClassName) of Utilities\TempClassLib to (m.tcNewClassName)

	add class (m.tcNewClassName) of Utilities\TempClassLib to (m.tcClassLib) overwrite

CATCH TO loException
	=ErrorMsg(m.loException.message)
endtry

endfunc
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform