Sample code for 30+ languages & platforms
PowerBuilder

Transition from Email.Clone to Email.MakeCopy

Provides instructions for replacing deprecated Clone method calls with MakeCopy.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Email
oleobject loo_EmailObj
oleobject loo_EmailOut

li_Success = 0

loo_Email = create oleobject
li_rc = loo_Email.ConnectToNewObject("Chilkat.Email")
if li_rc < 0 then
    destroy loo_Email
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// ...
// ...

// ------------------------------------------------------------------------
// The Clone method is deprecated:

loo_EmailObj = loo_Email.Clone()
if loo_Email.LastMethodSuccess = 0 then
    Write-Debug loo_Email.LastErrorText
    destroy loo_Email
    return
end if

// ...
// ...

destroy loo_EmailObj

// ------------------------------------------------------------------------
// Do the equivalent using MakeCopy.
// Your application creates a new, empty Email object which is passed 
// in the last argument and filled upon success.

loo_EmailOut = create oleobject
li_rc = loo_EmailOut.ConnectToNewObject("Chilkat.Email")

li_Success = loo_Email.MakeCopy(loo_EmailOut)
if li_Success = 0 then
    Write-Debug loo_Email.LastErrorText
    destroy loo_Email
    destroy loo_EmailOut
    return
end if



destroy loo_Email
destroy loo_EmailOut