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.

New datawindow?

7 posts in Objects Last posting was on 2003-07-30 19:53:08.0Z
Jose Manuel Posted on 2003-07-29 13:36:13.0Z
From: "Jose Manuel" <jmpersonal@wanadoo.es>
Newsgroups: sybase.public.powerbuilder.objects
Subject: New datawindow?
Lines: 6
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 89.red-80-24-166.pooles.rima-tde.net
X-Original-NNTP-Posting-Host: 89.red-80-24-166.pooles.rima-tde.net
Message-ID: <3f26784d$1@forums-1-dub>
Date: 29 Jul 2003 06:36:13 -0700
X-Trace: forums-1-dub 1059485773 80.24.166.89 (29 Jul 2003 06:36:13 -0700)
X-Original-Trace: 29 Jul 2003 06:36:13 -0700, 89.red-80-24-166.pooles.rima-tde.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7519
Article PK: 734807

I want to create a datawindow in a function. The new datawindow is identical
to another that is received in function as parameter ( passed by value ) and
when i manipulate the datawindow inside the function, the original
datawindow is modified. Why?.


Steve Katz [TeamSybase] Posted on 2003-07-29 14:15:49.0Z
Sender: 55ed.3f2680e7.1804289383@sybase.com
From: Steve Katz [TeamSybase]
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: New datawindow?
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3f268195.560a.846930886@sybase.com>
References: <3f26784d$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 29 Jul 2003 07:15:49 -0700
X-Trace: forums-1-dub 1059488149 10.22.241.41 (29 Jul 2003 07:15:49 -0700)
X-Original-Trace: 29 Jul 2003 07:15:49 -0700, 10.22.241.41
Lines: 18
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7520
Article PK: 734809

>>I want to create a datawindow in a function. The new
datawindow is identical to another that is received in
function as parameter ( passed by value ) and when i
manipulate the datawindow inside the function, the original
datawindow is modified. Why?.
<<

Most objects in PB are passed by reference even when you
indicate to pass by value. IOW, a pointer to the object is
passed; the full object itself is not passed on the stack.

How are your trying to create a new datawindow from an
existing dw reference? Do you mean that you are assigning a
different data object, data, or changing attributes via
Modify()?

steve
[TeamSybase]


Jose Manuel Posted on 2003-07-29 22:35:49.0Z
From: "Jose Manuel" <jmpersonal@wanadoo.es>
Newsgroups: sybase.public.powerbuilder.objects
References: <3f26784d$1@forums-1-dub> <3f268195.560a.846930886@sybase.com>
Subject: Re: New datawindow?
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 62-36-51-109.dialup.uni2.es
X-Original-NNTP-Posting-Host: 62-36-51-109.dialup.uni2.es
Message-ID: <3f26f6c5@forums-1-dub>
Date: 29 Jul 2003 15:35:49 -0700
X-Trace: forums-1-dub 1059518149 62.36.51.109 (29 Jul 2003 15:35:49 -0700)
X-Original-Trace: 29 Jul 2003 15:35:49 -0700, 62-36-51-109.dialup.uni2.es
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7522
Article PK: 734810

This is correct. I want to construct an object that receive a datawindow (
that user view in a window ) and via Modify() changes somes attributes of
the dw ( colors, borders, add a subreport with a logo, page nº...) and print
it.
I used an instance variable of datawindow type, but the changes over the
datawindow object, to reflect also over the dw of the window.
I intented to use GetFullState and SetFullState but the result is a GPF.
Also i created a function in the object but i have the same results. ( this
is my previous question).

Actually i have two identical datawindows, one for screen and another for
printer and every changes that the client request, i need to make it twice.

What is the correct solution for this?

Thanks.

<Steve Katz [TeamSybase]> escribió en el mensaje
news:3f268195.560a.846930886@sybase.com...

> >>I want to create a datawindow in a function. The new
> datawindow is identical to another that is received in
> function as parameter ( passed by value ) and when i
> manipulate the datawindow inside the function, the original
> datawindow is modified. Why?.
> <<
>
> Most objects in PB are passed by reference even when you
> indicate to pass by value. IOW, a pointer to the object is
> passed; the full object itself is not passed on the stack.
>
> How are your trying to create a new datawindow from an
> existing dw reference? Do you mean that you are assigning a
> different data object, data, or changing attributes via
> Modify()?
>
> steve
> [TeamSybase]


"Chris Werner" <cw[please_no_spam] Posted on 2003-07-30 07:08:48.0Z
From: "Chris Werner" <cw[please_no_spam]@f-s.de>
Newsgroups: sybase.public.powerbuilder.objects
References: <3f26784d$1@forums-1-dub> <3f268195.560a.846930886@sybase.com> <3f26f6c5@forums-1-dub>
Subject: Re: New datawindow?
Lines: 91
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: fs-software.berlin.kkf.net
X-Original-NNTP-Posting-Host: fs-software.berlin.kkf.net
Message-ID: <3f276f00$1@forums-1-dub>
Date: 30 Jul 2003 00:08:48 -0700
X-Trace: forums-1-dub 1059548928 212.63.55.62 (30 Jul 2003 00:08:48 -0700)
X-Original-Trace: 30 Jul 2003 00:08:48 -0700, fs-software.berlin.kkf.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7523
Article PK: 734808

Hi Jose,

I think you have to build a copy
of the original datawindow. You need
a (local or instance) variable of type
datawindow (or datastore if it is only for
printing). Then you have to copy the
actual design of the source datawindow.
At the end share or copy the data and
use the new datastore like intended.
This (untested) code shows this step
by step:

function uf_printDW(datawindow adw_source) returns integer

integer li_ret
string ls_syntax, ls_error
datastore lds_print

// create the print datastore:
lds_print = create datastore

// copy the design from adw_source:
ls_syntax = adw_source.describe("datawindow.syntax")
li_ret = lds_print.create(ls_syntax, ls_err)

// share the data:
if li_ret = 1 then
li_ret = adw_source.shareData(lds_print)
end if

// use lds_print:
if li_ret = 1 then
lds_print.modify(...)
end if

// don't forget ;)
destroy lds_print

return li_ret


--
Chris Werner

"Jose Manuel" <jmpersonal@wanadoo.es> schrieb im Newsbeitrag
news:3f26f6c5@forums-1-dub...

> This is correct. I want to construct an object that receive a datawindow (
> that user view in a window ) and via Modify() changes somes attributes of
> the dw ( colors, borders, add a subreport with a logo, page nº...) and
print
> it.
> I used an instance variable of datawindow type, but the changes over the
> datawindow object, to reflect also over the dw of the window.
> I intented to use GetFullState and SetFullState but the result is a GPF.
> Also i created a function in the object but i have the same results. (
this
> is my previous question).
>
> Actually i have two identical datawindows, one for screen and another for
> printer and every changes that the client request, i need to make it
twice.
>
> What is the correct solution for this?
>
> Thanks.
>
> <Steve Katz [TeamSybase]> escribió en el mensaje
> news:3f268195.560a.846930886@sybase.com...
> > >>I want to create a datawindow in a function. The new
> > datawindow is identical to another that is received in
> > function as parameter ( passed by value ) and when i
> > manipulate the datawindow inside the function, the original
> > datawindow is modified. Why?.
> > <<
> >
> > Most objects in PB are passed by reference even when you
> > indicate to pass by value. IOW, a pointer to the object is
> > passed; the full object itself is not passed on the stack.
> >
> > How are your trying to create a new datawindow from an
> > existing dw reference? Do you mean that you are assigning a
> > different data object, data, or changing attributes via
> > Modify()?
> >
> > steve
> > [TeamSybase]
>
>


Chris Pollach Posted on 2003-07-30 13:31:12.0Z
From: "Chris Pollach" <PollachC@SCC-CSC.gc.ca>
Newsgroups: sybase.public.powerbuilder.objects
References: <3f26784d$1@forums-1-dub>
Subject: Re: New datawindow?
Lines: 43
Organization: The Supreme Court of Canada
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 209.47.227.135
X-Original-NNTP-Posting-Host: 209.47.227.135
Message-ID: <3f27c8a0@forums-1-dub>
Date: 30 Jul 2003 06:31:12 -0700
X-Trace: forums-1-dub 1059571872 209.47.227.135 (30 Jul 2003 06:31:12 -0700)
X-Original-Trace: 30 Jul 2003 06:31:12 -0700, 209.47.227.135
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7524
Article PK: 734811

Jose;

Easy ..... (sort of) ....

1) Export the syntax of the DW-A (from the library painter) to a text file.
2) At Run Time, Use the FileRead ( ) method to load this into a String
variable.
3) Use the Create ( ) method on a DW Control (or DataStore) and pass it the
variable from Step #2.
4) Now you have a Dynamic DW that looks like DW-A. You can now use the
Modify ( ) method as required.

Note: To make this truly dynamic, send you PBL's along with your compiled
application EXE that contain the DW's you might want to go after in
production. Use the PB LibraryDirectory ( ) and LibraryExport ( ) methods to
extract the DW Object source code "on-the-fly". Once you have that proceed
to Step #2 above!

Suggestion: Export all your DW's Source code and store it in your DB Server
in a BLOB column, At run time, use a SelectBlob SQL statement to read the DW
source code into a variable. Then proceed to Step #2 above!

Hope that gives you some ideas. I have used these successfully in many
applications.

regards ... Chris
Great White North Technical Evangelist

"Jose Manuel" <jmpersonal@wanadoo.es> wrote in message
news:3f26784d$1@forums-1-dub...
> I want to create a datawindow in a function. The new datawindow is
identical
> to another that is received in function as parameter ( passed by value )
and
> when i manipulate the datawindow inside the function, the original
> datawindow is modified. Why?.
>
>


Phil Yandel Posted on 2003-07-30 18:24:09.0Z
From: "Phil Yandel" <Philip.C.Yandel@NOSPAM.Household.Com>
Newsgroups: sybase.public.powerbuilder.objects
Organization: 63.111.163.13
References: <3f26784d$1@forums-1-dub> <3f27c8a0@forums-1-dub>
X-Newsreader: AspNNTP 1.50 (Tri Hoang)
Subject: Re: New datawindow?
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: transinc-win02.netoptex.com
X-Original-NNTP-Posting-Host: transinc-win02.netoptex.com
Message-ID: <3f280d49$1@forums-1-dub>
Date: 30 Jul 2003 11:24:09 -0700
X-Trace: forums-1-dub 1059589449 206.169.167.22 (30 Jul 2003 11:24:09 -0700)
X-Original-Trace: 30 Jul 2003 11:24:09 -0700, transinc-win02.netoptex.com
Lines: 67
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7525
Article PK: 734812

You should be able to get the DW syntax at run time using the following:

String dwSyntax
dwSyntax = dw_1.describe("datawindow.syntax");

And then use the resulting string to create the new DataStore/DataWindow:

dw_2.create(dwSyntax, errors);

Of course you should be able to just do the following:

dw_2.DataObject = dw_1.DataObject




On 30 Jul 2003 06:31:12 -0700,
in sybase.public.powerbuilder.objects

Chris Pollach <PollachC@SCC-CSC.gc.ca> wrote:
>Jose;
>
> Easy ..... (sort of) ....
>
>1) Export the syntax of the DW-A (from the library painter) to a text file.
>2) At Run Time, Use the FileRead ( ) method to load this into a String
>variable.
>3) Use the Create ( ) method on a DW Control (or DataStore) and pass it the
>variable from Step #2.
>4) Now you have a Dynamic DW that looks like DW-A. You can now use the
>Modify ( ) method as required.
>
>Note: To make this truly dynamic, send you PBL's along with your compiled
>application EXE that contain the DW's you might want to go after in
>production. Use the PB LibraryDirectory ( ) and LibraryExport ( ) methods to
>extract the DW Object source code "on-the-fly". Once you have that proceed
>to Step #2 above!
>
>Suggestion: Export all your DW's Source code and store it in your DB Server
>in a BLOB column, At run time, use a SelectBlob SQL statement to read the DW
>source code into a variable. Then proceed to Step #2 above!
>
>Hope that gives you some ideas. I have used these successfully in many
>applications.
>
>regards ... Chris
>Great White North Technical Evangelist
>
>
>
>
>"Jose Manuel" <jmpersonal@wanadoo.es> wrote in message
>news:3f26784d$1@forums-1-dub...
>> I want to create a datawindow in a function. The new datawindow is
>identical
>> to another that is received in function as parameter ( passed by value )
>and
>> when i manipulate the datawindow inside the function, the original
>> datawindow is modified. Why?.
>>
>>
>
>

Phil Yandel
Household International
Philip.C.Yandel@Household.com (Work)
PhilCYa@Yahoo.com (Personal)


Philip Salgannik Posted on 2003-07-30 19:53:08.0Z
Sender: 2ad0.3f2821a4.1804289383@sybase.com
From: Philip Salgannik
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: New datawindow?
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3f282223.2adb.846930886@sybase.com>
References: <3f280d49$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 30 Jul 2003 12:53:08 -0700
X-Trace: forums-1-dub 1059594788 10.22.241.41 (30 Jul 2003 12:53:08 -0700)
X-Original-Trace: 30 Jul 2003 12:53:08 -0700, 10.22.241.41
Lines: 6
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7526
Article PK: 734813


>Of course you should be able to just do the following:
>dw_2.DataObject = dw_1.DataObject

The "Of course" part of the above statement is obviously
contingent on the fact that dw_1 had a valid DataObject
assigned to it (versus created on the fly from syntax)...