Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to copy an existing class
Message
From
18/05/1998 18:57:18
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00091332
Message ID:
00100209
Views:
59
>>>>Thank you for the response.
>>>>I will try that method; however, I wonder why the books I'm reading state that you can copy classes using the Class Browser. Oh well....
>>>>
>>>>thanks again.
>>>>
>>>>Tom Snider
>>>
>>>Hi Tom,
>>>
>>>You were on the right track using two instances of the class browser. What the documentation doesn't clearly state is that to drag and drop you need to select the class (single mouse click) and its icon will appear in the upper left section of the class browser. Drag this icon to the other class browser and the class will copy. HTH
>>
>>Colin-
>>
>>I just tried this and my classes were moved, not copied.
>>
>>Sylvia
>
>I have written a quick program which I run off a custom menu while I'm developing that will copy a class out of one class library to another class library(see attached ".PRG"). To run the program, just type :
>
>CPYCLASS .
>
>The expression builder will then popup asking for the name of the class to copy. Type in the name of the class to copy (not class library) and surround it with quotes. Once you have clicked "OK", a "Open File" dialog box will appear asking you to select the source class library to copy from. Another dialog box will then ask for the destination class library to copy the class to.
>
>If you have any problems with the attached file, here is the source code:
>
>* PROGRAM: CpyClass
>* AUTHOR: David Gamble
>* COMPLETED: 1/21/98
>
>* Utility to copy a class from once class library to another. If a class of the same name exists in the
>* destination library, overwrite it.
>
>LOCAL cClassName,cSource,cDest
>
>*-- Get the class name
>GETEXPR "Enter Class Name:" TO cClassName TYPE "C" DEFAULT ""
>
>IF NOT(EMPTY(cClassName) OR ISNULL(cClassName))
> *-- User did not "ESC","CANCEL", or just crash out of it
>
> cSource=GETFILE("VCX","Source Class") &&-- Get name of source class library
> IF NOT EMPTY(cSource)
>
> cDest=GETFILE("VCX","Dest Class") &&-- Get name of destination class library
> IF NOT EMPTY(cDest)
> *-- User did not "ESC" or "CANCEL" from prompt
>
> ADD CLASS &cClassName OF (cSource) TO (cDest) OVERWRITE &&-- Copy the class
> ENDIF
> ENDIF
>ENDIF
>RETURN
>
>
>Please feel free to e-mail me any questions or comments about how to improve the program.
>
>------------------------
>David Gamble
>DGAMBLE@relay.CABLExpress.com

David -
I got your program. Thanks for sending it.
Sylvia
Previous
Reply
Map
View

Click here to load this message in the networking platform