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.

a question on window function...

4 posts in Objects Last posting was on 2010-05-05 01:07:40.0Z
neil Posted on 2010-05-04 03:58:24.0Z
Sender: 74f5.4bdf9aa9.1804289383@sybase.com
From: Neil
Newsgroups: sybase.public.powerbuilder.objects
Subject: a question on window function...
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4bdf9b60.7504.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 3 May 2010 20:58:24 -0700
X-Trace: forums-1-dub 1272945504 10.22.241.41 (3 May 2010 20:58:24 -0700)
X-Original-Trace: 3 May 2010 20:58:24 -0700, 10.22.241.41
Lines: 5
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:10001
Article PK: 737130

How do I create a window function that would accept argument
as reference iether datastore or datawindow?

TIA,
Neil


Scott Morris Posted on 2010-05-04 12:10:05.0Z
From: "Scott Morris" <bogus@bogus.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <4bdf9b60.7504.1681692777@sybase.com>
Subject: Re: a question on window function...
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4be00e9d$1@forums-1-dub>
Date: 4 May 2010 05:10:05 -0700
X-Trace: forums-1-dub 1272975005 10.22.241.152 (4 May 2010 05:10:05 -0700)
X-Original-Trace: 4 May 2010 05:10:05 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:10002
Article PK: 737131


<Neil> wrote in message news:4bdf9b60.7504.1681692777@sybase.com...
> How do I create a window function that would accept argument
> as reference iether datastore or datawindow?
>
> TIA,
> Neil

There is no common ancestor - so you either write duplicate functions that
accept one or the other, or a single function that has two arguments (one of
each).


Ivaylo Ivanov Posted on 2010-05-04 12:35:28.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <4bdf9b60.7504.1681692777@sybase.com>
Subject: Re: a question on window function...
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4be01490$1@forums-1-dub>
Date: 4 May 2010 05:35:28 -0700
X-Trace: forums-1-dub 1272976528 10.22.241.152 (4 May 2010 05:35:28 -0700)
X-Original-Trace: 4 May 2010 05:35:28 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:10003
Article PK: 737132

How's that:

function wf_show_me_the_money(ref powerobject apo_data_source) returns
string

classdefinition lcd_holder

lcd_holder = apo_data_source.ClassDefinition

if (Lower(lcd_holder.DataTypeOf) <> "datawindow") and
(Lower(lcd_holder.DataTypeOf) <> "datastore") and
(Lower(lcd_holder.DataTypeOf) <> "datawindowchild") then return ""

// you can downcast to datawindow, datastore or datawindowchild here...
//choose case Lower(lcd_holder.DataTypeOf)
// case "datawindow"
// datawindow ldw_temp
// ldw_temp = apo_data_source
// case "datastore"
// datastore lds_temp
// lds_temp = apo_data_source
// case "datawindowchild"
// datawindowchild ldwch_temp
// ldwch_temp = apo_data_source
//end choose

return apo_data_source.Dynamic Describe("Datawindow.Objects")

Their common ancestor is "powerobject" which is the root of all PB classes.
There's a safety check at the beginning to eliminate error situations. After
that you can make Dynamic calls to the methods of the passed reference or if
you prefer - to downcast the argument in a local variable.

Regards,
Ivaylo

<Neil> wrote in message news:4bdf9b60.7504.1681692777@sybase.com...
> How do I create a window function that would accept argument
> as reference iether datastore or datawindow?
>
> TIA,
> Neil


neil Posted on 2010-05-05 01:07:40.0Z
Sender: 74f5.4bdf9aa9.1804289383@sybase.com
From: Neil
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: a question on window function...
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4be0c4dc.1e80.1681692777@sybase.com>
References: <4be01490$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 4 May 2010 18:07:40 -0700
X-Trace: forums-1-dub 1273021660 10.22.241.41 (4 May 2010 18:07:40 -0700)
X-Original-Trace: 4 May 2010 18:07:40 -0700, 10.22.241.41
Lines: 53
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:10004
Article PK: 737134

This is a great catch!

Thanks a lot...

> How's that:
>
> function wf_show_me_the_money(ref powerobject
> apo_data_source) returns string
>
> classdefinition lcd_holder
>
> lcd_holder = apo_data_source.ClassDefinition
>
> if (Lower(lcd_holder.DataTypeOf) <> "datawindow") and
> (Lower(lcd_holder.DataTypeOf) <> "datastore") and
> (Lower(lcd_holder.DataTypeOf) <> "datawindowchild") then
> return ""
>
> // you can downcast to datawindow, datastore or
> datawindowchild here... //choose case
> Lower(lcd_holder.DataTypeOf) // case "datawindow"
> // datawindow ldw_temp
> // ldw_temp = apo_data_source
> // case "datastore"
> // datastore lds_temp
> // lds_temp = apo_data_source
> // case "datawindowchild"
> // datawindowchild ldwch_temp
> // ldwch_temp = apo_data_source
> //end choose
>
> return apo_data_source.Dynamic
> Describe("Datawindow.Objects")
>
> Their common ancestor is "powerobject" which is the root
> of all PB classes. There's a safety check at the
> beginning to eliminate error situations. After that you
> can make Dynamic calls to the methods of the passed
> reference or if you prefer - to downcast the argument in
> a local variable.
>
> Regards,
> Ivaylo
>
> <Neil> wrote in message
> > news:4bdf9b60.7504.1681692777@sybase.com... How do I
> > create a window function that would accept argument as
> reference iether datastore or datawindow? >
> > TIA,
> > Neil
>
>