Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to copy a class in a .VCX
Message
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 6 SP5
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01045315
Message ID:
01126171
Views:
34
>Dodi,
>
>It's easy enough with VFP itself. If you have to classlibs in your project already, if not create a temp.vcx, drag the class you want to copy from the source and drop it on the other classlib, rename the copy, drag it back to the original, delete the copy from the temp holding place.
>
>>I tried locating DupClass Class Browser add-in after clicking the link but it's not there...

Here is the function I wrote to do this:
************************************************************
*  FUNCTION CopyVisualClass()
************************************************************
*  Author............: VCS  Developers Team
*  Project...........: Visual Collections System
*  Created...........: 01/24/2006  10:40:57
*  Copyright.........: (c) Jzanus, 2006
*) Description.......:
*  Calling Samples...:
*  Parameter List....:
*  Major change list.:
function CopyVisualClass
lparameters tcClassName, tcNewClassName, tcClassLib
local lcClassName, lcNewClassName, lcClassLib

if vartype(m.tcClassName) <> "C" 
	lcClassName = inputbox('Type class name', 'Choose class to copy', 'QueueAssignmentBar')
else
	lcClassName = m.tcClassName	
endif
if vartype(m.tcNewClassName) <> "C" 
	lcNewClassName = inputbox('Type new class name', 'New class Name', 'ScheduleCloseBar')
else
	lcNewClassName = m.tcNewClassName	
endif
if vartype(m.tcClassLib) <> "C"
	lcClassLib = getfile('vcx', 'Select ClassLib', 'Select', 0, 'Select classlibrary to create new class in')
else
	lcClassLib = m.tcClassLib	
endif

local loException
try
	add class (m.lcClassName) to Utilities\TempClassLib overwrite

	rename class (m.lcClassName) of Utilities\TempClassLib to (m.lcNewClassName)

	add class (m.lcNewClassName) of Utilities\TempClassLib to (m.lcClassLib) overwrite

catch to loException
	=ErrorMsg(m.loException.message)
endtry

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


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform