Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

copy (duplicate) object (not a pointer)

13 posts in Objects Last posting was on 2006-03-25 12:50:55.0Z
Bernhard Ehemoser Posted on 2006-01-30 11:48:06.0Z
Sender: 20a2.43ddec79.1804289383@sybase.com
From: Bernhard Ehemoser
Newsgroups: sybase.public.powerbuilder.objects
Subject: copy (duplicate) object (not a pointer)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <43ddee29.20af.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 30 Jan 2006 02:44:57 -0800, 10.22.241.42
Lines: 16
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Jan 2006 02:44:59 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Jan 2006 03:48:06 -0800
X-Trace: forums-1-dub 1138621686 10.22.108.75 (30 Jan 2006 03:48:06 -0800)
X-Original-Trace: 30 Jan 2006 03:48:06 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8751
Article PK: 735966

i need to duplicate a object (not a pointer).

maybe it's not really a problem but i don't know how to
solve.

sample:
gds_target = gds_source
gds_target points to gds_source

but i don't need a pointer - i need a copy of the
source-object. i need this to save the gds_source for later
use.

thanks in advance.

greets b.ehemoser


Philip Salgannik Posted on 2006-01-30 13:53:11.0Z
From: "Philip Salgannik" <philemaxNOSPAM@comcast.net>
Newsgroups: sybase.public.powerbuilder.objects
References: <43ddee29.20af.1681692777@sybase.com>
Subject: Re: copy (duplicate) object (not a pointer)
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: c-24-34-75-142.hsd1.ma.comcast.net
Message-ID: <43de0b7c@forums-2-dub>
X-Original-Trace: 30 Jan 2006 04:50:04 -0800, c-24-34-75-142.hsd1.ma.comcast.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Jan 2006 04:50:04 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Jan 2006 05:53:11 -0800
X-Trace: forums-1-dub 1138629191 10.22.108.75 (30 Jan 2006 05:53:11 -0800)
X-Original-Trace: 30 Jan 2006 05:53:11 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8752
Article PK: 735961

This is a FAQ. There is no deep copying in PB, you'll have to write it
yourself.

<Bernhard Ehemoser> wrote in message
news:43ddee29.20af.1681692777@sybase.com...
>i need to duplicate a object (not a pointer).
>
> maybe it's not really a problem but i don't know how to
> solve.
>
> sample:
> gds_target = gds_source
> gds_target points to gds_source
>
> but i don't need a pointer - i need a copy of the
> source-object. i need this to save the gds_source for later
> use.
>
> thanks in advance.
>
> greets b.ehemoser


Jason 'Bug' Fenter <fenterbug_ Posted on 2006-01-30 19:40:08.0Z
From: Jason 'Bug' Fenter <fenterbug_@_hotmail_dot_com>
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: copy (duplicate) object (not a pointer)
References: <43ddee29.20af.1681692777@sybase.com> <43de0b7c@forums-2-dub>
In-Reply-To: <43de0b7c@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: ppp-70-251-135-241.dsl.rcsntx.swbell.net
Message-ID: <43de5ccc$1@forums-2-dub>
X-Original-Trace: 30 Jan 2006 10:37:00 -0800, ppp-70-251-135-241.dsl.rcsntx.swbell.net
Lines: 28
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Jan 2006 10:37:01 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Jan 2006 11:40:08 -0800
X-Trace: forums-1-dub 1138650008 10.22.108.75 (30 Jan 2006 11:40:08 -0800)
X-Original-Trace: 30 Jan 2006 11:40:08 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8753
Article PK: 735960

With the exception of autoinstantiated objects which do, indeed, provide
deep copying instead of object referencing.

Philip Salgannik wrote:
> This is a FAQ. There is no deep copying in PB, you'll have to write it
> yourself.
>
> <Bernhard Ehemoser> wrote in message
> news:43ddee29.20af.1681692777@sybase.com...
>> i need to duplicate a object (not a pointer).
>>
>> maybe it's not really a problem but i don't know how to
>> solve.
>>
>> sample:
>> gds_target = gds_source
>> gds_target points to gds_source
>>
>> but i don't need a pointer - i need a copy of the
>> source-object. i need this to save the gds_source for later
>> use.
>>
>> thanks in advance.
>>
>> greets b.ehemoser
>
>


Chris Pollach Posted on 2006-01-30 20:33:47.0Z
From: "Chris Pollach" <cpollach@travel-net.dot.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <43ddee29.20af.1681692777@sybase.com> <43de0b7c@forums-2-dub> <43de5ccc$1@forums-2-dub>
Subject: Re: copy (duplicate) object (not a pointer)
Lines: 37
Organization: STD Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4927.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
NNTP-Posting-Host: stealth.nserc.ca
X-Original-NNTP-Posting-Host: stealth.nserc.ca
Message-ID: <43de782b$1@forums-1-dub>
Date: 30 Jan 2006 12:33:47 -0800
X-Trace: forums-1-dub 1138653227 198.96.2.93 (30 Jan 2006 12:33:47 -0800)
X-Original-Trace: 30 Jan 2006 12:33:47 -0800, stealth.nserc.ca
X-Authenticated-User: pb105beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8754
Article PK: 735962

But only a Jedi Master would know that *g* (or someone who took the OO
course)!

"Jason 'Bug' Fenter" <fenterbug_@_hotmail_dot_com> wrote in message
news:43de5ccc$1@forums-2-dub...
> With the exception of autoinstantiated objects which do, indeed, provide
> deep copying instead of object referencing.
>
>
> Philip Salgannik wrote:
> > This is a FAQ. There is no deep copying in PB, you'll have to write it
> > yourself.
> >
> > <Bernhard Ehemoser> wrote in message
> > news:43ddee29.20af.1681692777@sybase.com...
> >> i need to duplicate a object (not a pointer).
> >>
> >> maybe it's not really a problem but i don't know how to
> >> solve.
> >>
> >> sample:
> >> gds_target = gds_source
> >> gds_target points to gds_source
> >>
> >> but i don't need a pointer - i need a copy of the
> >> source-object. i need this to save the gds_source for later
> >> use.
> >>
> >> thanks in advance.
> >>
> >> greets b.ehemoser
> >
> >


Jason 'Bug' Fenter <fenterbug_ Posted on 2006-01-30 21:03:03.0Z
From: Jason 'Bug' Fenter <fenterbug_@_hotmail_dot_com>
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: copy (duplicate) object (not a pointer)
References: <43ddee29.20af.1681692777@sybase.com> <43de0b7c@forums-2-dub> <43de5ccc$1@forums-2-dub> <43de782b$1@forums-1-dub>
In-Reply-To: <43de782b$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 66.196.228.211
Message-ID: <43de703a$1@forums-2-dub>
X-Original-Trace: 30 Jan 2006 11:59:54 -0800, 66.196.228.211
Lines: 40
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Jan 2006 11:59:55 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Jan 2006 13:03:03 -0800
X-Trace: forums-1-dub 1138654983 10.22.108.75 (30 Jan 2006 13:03:03 -0800)
X-Original-Trace: 30 Jan 2006 13:03:03 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8757
Article PK: 735967

Hmm... I never took the OO course. Maybe I have a hidden talent with
mind tricks and telekinesis? :D (If only I were so lucky...)

Chris Pollach wrote:
> But only a Jedi Master would know that *g* (or someone who took the OO
> course)!
>
>
> "Jason 'Bug' Fenter" <fenterbug_@_hotmail_dot_com> wrote in message
> news:43de5ccc$1@forums-2-dub...
>> With the exception of autoinstantiated objects which do, indeed, provide
>> deep copying instead of object referencing.
>>
>>
>> Philip Salgannik wrote:
>>> This is a FAQ. There is no deep copying in PB, you'll have to write it
>>> yourself.
>>>
>>> <Bernhard Ehemoser> wrote in message
>>> news:43ddee29.20af.1681692777@sybase.com...
>>>> i need to duplicate a object (not a pointer).
>>>>
>>>> maybe it's not really a problem but i don't know how to
>>>> solve.
>>>>
>>>> sample:
>>>> gds_target = gds_source
>>>> gds_target points to gds_source
>>>>
>>>> but i don't need a pointer - i need a copy of the
>>>> source-object. i need this to save the gds_source for later
>>>> use.
>>>>
>>>> thanks in advance.
>>>>
>>>> greets b.ehemoser
>>>
>
>


Philip Salgannik Posted on 2006-01-30 20:45:47.0Z
Sender: 2cbe.43de6bfb.1804289383@sybase.com
From: Philip Salgannik
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: copy (duplicate) object (not a pointer)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <43de6c2b.2cc1.1681692777@sybase.com>
References: <43de5ccc$1@forums-2-dub>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 30 Jan 2006 11:42:35 -0800, 10.22.241.42
Lines: 32
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Jan 2006 11:42:38 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Jan 2006 12:45:47 -0800
X-Trace: forums-1-dub 1138653947 10.22.108.75 (30 Jan 2006 12:45:47 -0800)
X-Original-Trace: 30 Jan 2006 12:45:47 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8755
Article PK: 735964

That is actually an incorrect statement.
autoinstantiated objects provide deep copying of what?

> With the exception of autoinstantiated objects which do,
> indeed, provide deep copying instead of object
> referencing.
>
>
> Philip Salgannik wrote:
> > This is a FAQ. There is no deep copying in PB, you'll
> > have to write it yourself.
> >
> > <Bernhard Ehemoser> wrote in message
> > news:43ddee29.20af.1681692777@sybase.com...
> >> i need to duplicate a object (not a pointer).
> >>
> >> maybe it's not really a problem but i don't know how to
> >> solve.
> >>
> >> sample:
> >> gds_target = gds_source
> >> gds_target points to gds_source
> >>
> >> but i don't need a pointer - i need a copy of the
> >> source-object. i need this to save the gds_source for
> later >> use.
> >>
> >> thanks in advance.
> >>
> >> greets b.ehemoser
> >
> >


Jason 'Bug' Fenter <fenterbug_ Posted on 2006-01-30 21:01:30.0Z
From: Jason 'Bug' Fenter <fenterbug_@_hotmail_dot_com>
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: copy (duplicate) object (not a pointer)
References: <43de5ccc$1@forums-2-dub> <43de6c2b.2cc1.1681692777@sybase.com>
In-Reply-To: <43de6c2b.2cc1.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 66.196.228.211
Message-ID: <43de6fcd@forums-2-dub>
X-Original-Trace: 30 Jan 2006 11:58:05 -0800, 66.196.228.211
Lines: 45
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Jan 2006 11:58:06 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Jan 2006 13:01:30 -0800
X-Trace: forums-1-dub 1138654890 10.22.108.75 (30 Jan 2006 13:01:30 -0800)
X-Original-Trace: 30 Jan 2006 13:01:30 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8756
Article PK: 735965

If a lack of "deep copying" means that
nvo1 = nvo2
assigns a reference of nvo2 to nvo1 instead of creating another instance
of the class with identical property values, then the presence of "deep
copying" for autoinstantiated objects means that
autoinstantiated_nvo1 = autoinstantiated_nvo2
does indeed create another instance of the class with identical property
values.

Is "deep copying" the correct term? I don't know. It was the term you
used in a blanket statement. I simply used it in the same context to
point out the exception to the rule.

Philip Salgannik wrote:
> That is actually an incorrect statement.
> autoinstantiated objects provide deep copying of what?
>
>> With the exception of autoinstantiated objects which do,
>> indeed, provide deep copying instead of object
>> referencing.
>>
>>
>> Philip Salgannik wrote:
>>> This is a FAQ. There is no deep copying in PB, you'll
>>> have to write it yourself.
>>>
>>> <Bernhard Ehemoser> wrote in message
>>> news:43ddee29.20af.1681692777@sybase.com...
>>>> i need to duplicate a object (not a pointer).
>>>>
>>>> maybe it's not really a problem but i don't know how to
>>>> solve.
>>>>
>>>> sample:
>>>> gds_target = gds_source
>>>> gds_target points to gds_source
>>>>
>>>> but i don't need a pointer - i need a copy of the
>>>> source-object. i need this to save the gds_source for
>> later >> use.
>>>> thanks in advance.
>>>>
>>>> greets b.ehemoser
>>>


Philip Salgannik Posted on 2006-01-31 03:06:56.0Z
From: "Philip Salgannik" <philemaxNOSPAM@comcast.net>
Newsgroups: sybase.public.powerbuilder.objects
References: <43de5ccc$1@forums-2-dub> <43de6c2b.2cc1.1681692777@sybase.com> <43de6fcd@forums-2-dub>
Subject: Re: copy (duplicate) object (not a pointer)
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: c-24-34-75-142.hsd1.ma.comcast.net
X-Original-NNTP-Posting-Host: c-24-34-75-142.hsd1.ma.comcast.net
Message-ID: <43ded450@forums-1-dub>
Date: 30 Jan 2006 19:06:56 -0800
X-Trace: forums-1-dub 1138676816 24.34.75.142 (30 Jan 2006 19:06:56 -0800)
X-Original-Trace: 30 Jan 2006 19:06:56 -0800, c-24-34-75-142.hsd1.ma.comcast.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8758
Article PK: 735968

In that case you are correct :-)

"Jason 'Bug' Fenter" <fenterbug_@_hotmail_dot_com> wrote in message
news:43de6fcd@forums-2-dub...
> If a lack of "deep copying" means that
> nvo1 = nvo2
> assigns a reference of nvo2 to nvo1 instead of creating another instance
> of the class with identical property values, then the presence of "deep
> copying" for autoinstantiated objects means that
> autoinstantiated_nvo1 = autoinstantiated_nvo2
> does indeed create another instance of the class with identical property
> values.
>
> Is "deep copying" the correct term? I don't know. It was the term you used
> in a blanket statement. I simply used it in the same context to point out
> the exception to the rule.
>
>
> Philip Salgannik wrote:
>> That is actually an incorrect statement.
>> autoinstantiated objects provide deep copying of what?
>>
>>> With the exception of autoinstantiated objects which do,
>>> indeed, provide deep copying instead of object
>>> referencing.
>>>
>>>
>>> Philip Salgannik wrote:
>>>> This is a FAQ. There is no deep copying in PB, you'll
>>>> have to write it yourself.
>>>>
>>>> <Bernhard Ehemoser> wrote in message
>>>> news:43ddee29.20af.1681692777@sybase.com...
>>>>> i need to duplicate a object (not a pointer).
>>>>>
>>>>> maybe it's not really a problem but i don't know how to
>>>>> solve.
>>>>>
>>>>> sample:
>>>>> gds_target = gds_source
>>>>> gds_target points to gds_source
>>>>>
>>>>> but i don't need a pointer - i need a copy of the
>>>>> source-object. i need this to save the gds_source for
>>> later >> use.
>>>>> thanks in advance.
>>>>>
>>>>> greets b.ehemoser
>>>>


Adam Simmonds [TeamSybase] Posted on 2006-02-01 22:26:04.0Z
From: "Adam Simmonds [TeamSybase]" <adam.simmonds@REMOVEexemail.com.au>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: copy (duplicate) object (not a pointer)
References: <43de5ccc$1@forums-2-dub> <43de6c2b.2cc1.1681692777@sybase.com> <43de6fcd@forums-2-dub> <43ded450@forums-1-dub>
In-Reply-To: <43ded450@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 14.107.233.220.exetel.com.au
Message-ID: <43e1269d$1@forums-2-dub>
X-Original-Trace: 1 Feb 2006 13:22:37 -0800, 14.107.233.220.exetel.com.au
Lines: 64
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Feb 2006 13:22:38 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Feb 2006 14:26:04 -0800
X-Trace: forums-1-dub 1138832764 10.22.108.75 (1 Feb 2006 14:26:04 -0800)
X-Original-Trace: 1 Feb 2006 14:26:04 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8764
Article PK: 735972


Philip Salgannik wrote:
> In that case you are correct :-)

What is your definition of deep copying, Philip?
a.


>
> "Jason 'Bug' Fenter" <fenterbug_@_hotmail_dot_com> wrote in message
> news:43de6fcd@forums-2-dub...
>
>>If a lack of "deep copying" means that
>>nvo1 = nvo2
>>assigns a reference of nvo2 to nvo1 instead of creating another instance
>>of the class with identical property values, then the presence of "deep
>>copying" for autoinstantiated objects means that
>>autoinstantiated_nvo1 = autoinstantiated_nvo2
>>does indeed create another instance of the class with identical property
>>values.
>>
>>Is "deep copying" the correct term? I don't know. It was the term you used
>>in a blanket statement. I simply used it in the same context to point out
>>the exception to the rule.
>>
>>
>>Philip Salgannik wrote:
>>
>>>That is actually an incorrect statement.
>>>autoinstantiated objects provide deep copying of what?
>>>
>>>
>>>>With the exception of autoinstantiated objects which do,
>>>>indeed, provide deep copying instead of object
>>>>referencing.
>>>>
>>>>
>>>>Philip Salgannik wrote:
>>>>
>>>>>This is a FAQ. There is no deep copying in PB, you'll
>>>>>have to write it yourself.
>>>>>
>>>>><Bernhard Ehemoser> wrote in message
>>>>>news:43ddee29.20af.1681692777@sybase.com...
>>>>>
>>>>>>i need to duplicate a object (not a pointer).
>>>>>>
>>>>>>maybe it's not really a problem but i don't know how to
>>>>>>solve.
>>>>>>
>>>>>>sample:
>>>>>>gds_target = gds_source
>>>>>>gds_target points to gds_source
>>>>>>
>>>>>>but i don't need a pointer - i need a copy of the
>>>>>>source-object. i need this to save the gds_source for
>>>>
>>>>later >> use.
>>>>
>>>>>>thanks in advance.
>>>>>>
>>>>>>greets b.ehemoser
>>>>>
>
>


Joost Bloemsma <dontspam_joost.bloemsma Posted on 2006-03-22 13:52:55.0Z
From: Joost Bloemsma <dontspam_joost.bloemsma@dlm.nl.com_dontspam>
Reply-To: dontspam_joost.bloemsma@dlm.nl.com_dontspam
Organization: DLM bv
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: copy (duplicate) object (not a pointer)
References: <43ddee29.20af.1681692777@sybase.com> <43de0b7c@forums-2-dub> <43de5ccc$1@forums-2-dub>
In-Reply-To: <43de5ccc$1@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: dsl187-16-100.fastxdsl.nl
X-Original-NNTP-Posting-Host: dsl187-16-100.fastxdsl.nl
Message-ID: <442156b7$1@forums-1-dub>
Date: 22 Mar 2006 05:52:55 -0800
X-Trace: forums-1-dub 1143035575 80.100.16.187 (22 Mar 2006 05:52:55 -0800)
X-Original-Trace: 22 Mar 2006 05:52:55 -0800, dsl187-16-100.fastxdsl.nl
Lines: 42
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8810
Article PK: 736015

Is that so? I didn't know that!
Is there any reason autoinstantiated objects do provide cloning and
others don't?
--
******************************
** Joost A. Bloemsma
** PowerBuilder Developer
** DLM bv (www.dlm.nl.com)
******************************

Jason 'Bug' Fenter wrote:
> With the exception of autoinstantiated objects which do, indeed, provide
> deep copying instead of object referencing.
>
>
> Philip Salgannik wrote:
>
>> This is a FAQ. There is no deep copying in PB, you'll have to write it
>> yourself.
>>
>> <Bernhard Ehemoser> wrote in message
>> news:43ddee29.20af.1681692777@sybase.com...
>>
>>> i need to duplicate a object (not a pointer).
>>>
>>> maybe it's not really a problem but i don't know how to
>>> solve.
>>>
>>> sample:
>>> gds_target = gds_source
>>> gds_target points to gds_source
>>>
>>> but i don't need a pointer - i need a copy of the
>>> source-object. i need this to save the gds_source for later
>>> use.
>>>
>>> thanks in advance.
>>>
>>> greets b.ehemoser
>>
>>
>>


Jason 'Bug' Fenter <fenterbug_ Posted on 2006-03-22 16:47:54.0Z
From: Jason 'Bug' Fenter <fenterbug_@_hotmail_dot_com>
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: copy (duplicate) object (not a pointer)
References: <43ddee29.20af.1681692777@sybase.com> <43de0b7c@forums-2-dub> <43de5ccc$1@forums-2-dub> <442156b7$1@forums-1-dub>
In-Reply-To: <442156b7$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208-14-30-59.gcecisp.com
X-Original-NNTP-Posting-Host: 208-14-30-59.gcecisp.com
Message-ID: <44217fba$1@forums-1-dub>
Date: 22 Mar 2006 08:47:54 -0800
X-Trace: forums-1-dub 1143046074 208.14.30.59 (22 Mar 2006 08:47:54 -0800)
X-Original-Trace: 22 Mar 2006 08:47:54 -0800, 208-14-30-59.gcecisp.com
Lines: 9
X-Authenticated-User: pb105beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8811
Article PK: 736019


Joost Bloemsma wrote:
> Is that so? I didn't know that!
> Is there any reason autoinstantiated objects do provide cloning and
> others don't?

One reason that auto-instantiation was introduced was so that developers
could easily replace structures with objects. For that reason, the PB
guys make "ai" objects act like structures... which meant passing by
value instead of by reference.


Joost Bloemsma <dontspam_joost.bloemsma Posted on 2006-03-25 12:50:55.0Z
From: Joost Bloemsma <dontspam_joost.bloemsma@dlm.nl.com_dontspam>
Reply-To: dontspam_joost.bloemsma@dlm.nl.com_dontspam
Organization: DLM bv
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: WOW!
References: <43ddee29.20af.1681692777@sybase.com> <43de0b7c@forums-2-dub> <43de5ccc$1@forums-2-dub> <442156b7$1@forums-1-dub> <44217fba$1@forums-1-dub>
In-Reply-To: <44217fba$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: dsl187-16-100.fastxdsl.nl
Message-ID: <44252ca4@forums-2-dub>
X-Original-Trace: 25 Mar 2006 03:42:28 -0800, dsl187-16-100.fastxdsl.nl
Lines: 130
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 25 Mar 2006 03:42:30 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 25 Mar 2006 04:50:55 -0800
X-Trace: forums-1-dub 1143291055 10.22.108.75 (25 Mar 2006 04:50:55 -0800)
X-Original-Trace: 25 Mar 2006 04:50:55 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8816
Article PK: 736020

OK, that's new for me!

After six years of using PowerBuilder I still thought using
autoinstantiation was for lazy developers. But now I have what the
Germans call 'ein Aha Erlebnis'!

But isn't that dangerous, since you can assign an autoinstantiated
object to a variable of an nonautoinstantiated class type. The latter
one will behave like a not-autoinstantiated type, but still has the
IsAutoinstantiate property of the classdefinition set to true. This
means that if you make a method having a PowerObject argument you can
never know how the passed object will react to certain actions.

Example:

I made a simple AI class with only an integer property called a and two
methods for setting and getting the a, and called is n_cst_AI.
Then I ran the following code:

n_cst_ai ai1
PowerObject ai2
PowerObject ai3
ClassDefinition lcd_Class
String ls_Out

// Assing value to first object
ai1.of_SetA(2)

// copy it to PowerObject
ai2 = ai1

// Set new value to first object
ai1.of_SetA(3)

// Assign object ai2 (non-ai) to ai3 (non_ai)
ai3 = ai2

// Set new value to ai3
ai3.dynamic of_SetA(4)

// Read values
ls_Out = "Value ai1: " + string(ai1.a) + "~r~n" + &
"Value ai2: " + string(ai2.dynamic of_GetA()) + "~r~n" + &
"Value ai3: " + string(ai3.dynamic of_GetA()) + "~r~n" + &
"ClassName ai2: " + ai2.ClassName() + "~r~n" + &
"ClassName ai3: " + ai3.ClassName() + "~r~n"

// Test classdefinition property
lcd_Class = ai1.ClassDefinition

if lcd_Class.IsAutoinstantiate then
ls_Out += "ai1 is AutoInstantiated~r~n"
else
ls_Out += "ai1 is NOT AutoInstantiated~r~n"
end if

lcd_Class = ai2.ClassDefinition

if lcd_Class.IsAutoinstantiate then
ls_Out += "ai2 is AutoInstantiate~r~n"
else
ls_Out += "ai2 is NOT AutoInstantiate~r~n"
end if

lcd_Class = ai3.ClassDefinition

if lcd_Class.IsAutoinstantiate then
ls_Out += "ai3 is AutoInstantiate~r~n"
else
ls_Out += "ai3 is NOT AutoInstantiate~r~n"
end if

// Try to destroy
destroy ai2

if not isvalid(ai2) then
ls_Out += "ai2 is destroyed~r~n"
else
ls_Out += "ai2 is NOT destroyed~r~n"
end if

if not isvalid(ai3) then
ls_Out += "ai3 is destroyed~r~n"
else
ls_Out += "ai3 is NOT destroyed~r~n"
end if

MessageBox("result", ls_Out)



The result was:
Value ai1: 3
Value ai2: 4
Value ai3: 4
ClassName ai2: n_cst_ai
ClassName ai3: n_cst_ai
ai1 is AutoInstantiate
ai2 is AutoInstantiate
ai3 is AutoInstantiate
ai2 is destroyed
ai3 is destroyed

The assignment of ai2 to ai3 was obviously done by reference, even the
classdefinition says it's autoinstantiated.

So how can I test whether I have a copy of an ai class, or a reference
to the real ai class?


--
******************************
** Joost A. Bloemsma
** PowerBuilder Developer
** DLM bv (www.dlm.nl.com)
******************************

Jason 'Bug' Fenter wrote:
> Joost Bloemsma wrote:
>
>> Is that so? I didn't know that!
>> Is there any reason autoinstantiated objects do provide cloning and
>> others don't?
>
>
> One reason that auto-instantiation was introduced was so that developers
> could easily replace structures with objects. For that reason, the PB
> guys make "ai" objects act like structures... which meant passing by
> value instead of by reference.


Sanjiv Das [TeamSybase] Posted on 2006-02-01 21:56:49.0Z
From: "Sanjiv Das [TeamSybase]" <No-Spam-SDas_TeamSybase@HotMail.Com>
Newsgroups: sybase.public.powerbuilder.objects
References: <43ddee29.20af.1681692777@sybase.com>
Subject: Re: copy (duplicate) object (not a pointer)
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-Original-NNTP-Posting-Host: ip68-4-238-84.oc.oc.cox.net
Message-ID: <43e11fc5$1@forums-2-dub>
X-Original-Trace: 1 Feb 2006 12:53:25 -0800, ip68-4-238-84.oc.oc.cox.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Feb 2006 12:53:27 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Feb 2006 13:56:49 -0800
X-Trace: forums-1-dub 1138831009 10.22.108.75 (1 Feb 2006 13:56:49 -0800)
X-Original-Trace: 1 Feb 2006 13:56:49 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8763
Article PK: 735969

Bernhard,

What type of object are you trying to copy? I am not sure what your naming
conventions signify, so am not sure if that is a datastore.

Sanjiv.

<Bernhard Ehemoser> wrote in message
news:43ddee29.20af.1681692777@sybase.com...
>i need to duplicate a object (not a pointer).
>
> maybe it's not really a problem but i don't know how to
> solve.
>
> sample:
> gds_target = gds_source
> gds_target points to gds_source
>
> but i don't need a pointer - i need a copy of the
> source-object. i need this to save the gds_source for later
> use.
>
> thanks in advance.
>
> greets b.ehemoser