Jump to content
Developer Wiki and Function Reference Links ×

Duplicate Class


Recommended Posts

  • 2 weeks later...
  • 1 year later...

Well, it works, but it is quite tricky because the duplicate doesn't have a name after duplication...

Here's how I do :

function duplicateClass(className : string) : string;
Const 
   ProvName = '###NewClass###';
VAR
   newClass, class2duplicate :  handle;

BEGIN
   class2duplicate := Getobject(className);
   newClass := CreateDuplicateObject( class2duplicate,getparent(class2duplicate));
   SetName(newclass,ProvName);
   RenameClass(ProvName ,className);
   duplicateClass := Getname(newClass);  
END;

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...