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.

Problem calling Tab Page Function

7 posts in Objects Last posting was on 2008-03-07 21:04:23.0Z
Richard Hall Posted on 2008-03-06 20:27:26.0Z
Sender: 183.47d00b11.1804289383@sybase.com
From: Richard Hall
Newsgroups: sybase.public.powerbuilder.objects
Subject: Problem calling Tab Page Function
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47d053ad.8e6.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 6 Mar 2008 12:27:26 -0800
X-Trace: forums-1-dub 1204835246 10.22.241.41 (6 Mar 2008 12:27:26 -0800)
X-Original-Trace: 6 Mar 2008 12:27:26 -0800, 10.22.241.41
Lines: 30
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9624
Article PK: 736778

(Platform: Windows XP and PowerBuilder 8.0.1 Build 8004)

A function on a tab control needs to call a function on the
current tab page.
--------------------
INTEGER li_Msg
//
li_msg = This.tabpage_1.of_Function()
--------------------
This compiles, but when the the program runs, a window pops
up "Expression is not valid".

of_Function() returns an INTEGER and the Tag field of the
tab page has the correct value so the current page is indeed
the tab page with the function. tabpage_1 has the correct
tab page object as well.

The ancestor of the tab page has a rudimentary of_Function()
so this is not a situation where the compiler cannot
determine if the function exists at compile time.

I also tried the line below with the same result.
li_msg = This.tabpage_1.DYNAMIC of_Function()

I have been working with PowerBuilder for years, bur I have
not worked on tab controls and tab pages for years as well.

What obvious thing am I missing?

Rick


Roland Smith [TeamSybase] Posted on 2008-03-07 13:45:52.0Z
From: "Roland Smith [TeamSybase]" <rsmith_at_trusthss_dot_com>
Newsgroups: sybase.public.powerbuilder.objects
References: <47d053ad.8e6.1681692777@sybase.com>
Subject: Re: Problem calling Tab Page Function
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47d14710$1@forums-1-dub>
Date: 7 Mar 2008 05:45:52 -0800
X-Trace: forums-1-dub 1204897552 10.22.241.152 (7 Mar 2008 05:45:52 -0800)
X-Original-Trace: 7 Mar 2008 05:45:52 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9627
Article PK: 736771

In this example, u_tabpg_object is the user object containing the function.

Integer li_Msg
u_tabpg_object lu_tabpg

lu_tabpg = tab_main.tabpage_1

li_Msg = lu_tabpg.of_Function()


Roland Smith [TeamSybase] Posted on 2008-03-07 20:28:42.0Z
From: "Roland Smith [TeamSybase]" <rsmith_at_trusthss_dot_com>
Newsgroups: sybase.public.powerbuilder.objects
References: <47d14710$1@forums-1-dub> <47d17207.21a3.1681692777@sybase.com>
Subject: Re: Problem calling Tab Page Function
Lines: 81
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47d1a57a$1@forums-1-dub>
Date: 7 Mar 2008 12:28:42 -0800
X-Trace: forums-1-dub 1204921722 10.22.241.152 (7 Mar 2008 12:28:42 -0800)
X-Original-Trace: 7 Mar 2008 12:28:42 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9631
Article PK: 736772

If the function is within the tab object, why are you prefixing it with the
page name?

<Rickard Hall> wrote in message news:47d17207.21a3.1681692777@sybase.com...
> Thank you for the response. However ...
>
>> In this example, u_tabpg_object is the user object
>> containing the function.
>>
>> Integer li_Msg
>> u_tabpg_object lu_tabpg
>>
>> lu_tabpg = tab_main.tabpage_1
>>
>> li_Msg = lu_tabpg.of_Function()
>
> The function I am working in resides in the tab object, as
> per your example u_tab_object. I assume tab_main is an
> object that was placed on a window or some such.
>
> // example //
>
> INTEGER li_Msg
> u_tabpg_object lu_tabpg
>
> lu_tabpg = This.tabpage_1
>
> MessageBox( 'test', lu_tabpg.Tag )
> li_Msg = lu_tabpg.of_Function()
> li_Msg = lu_tabpg.of_Unique() // to see if this compiles
>
> // end example //
>
> This compiles.
>
> Adding a call to a function that is unique to
> u_tabpg_object, of_Unique() also compiles.
>
> When I run the function, the MessageBox displays the unique
> tab for u_tabpg_object. This proves to me that tabpage_1 is
> indeed an instance of u_tabpg_object.
>
> However the next line, the direct call of of_Function throws
> an error "Expression is not valid".
>
> Next I tried this
>
> // example //
>
> INTEGER li_Msg
> u_tabpg_object lu_tabpg
>
> lu_tabpg = This.Control[ 1 ] // rather than This.tabpage_1
>
> MessageBox( 'test', lu_tabpg.Tag )
> li_Msg = lu_tabpg.of_Function()
> li_Msg = lu_tabpg.of_Unique() // to see if this compiles
>
> // end example //
>
> This also compiles.
> The MessageBox displays the unique tag.
>
> However, is this case as well, the next line, the direct
> call of of_Function throws an error "Expression is not
> valid".
>
> May this be a problem with PowerBuilder 8.0.1 Build 8004? I
> would not think so since I worked with tab and tab page
> objects back in version 5 and 6.
>
> (This is a legacy product approaching end-of-life and -they-
> are not looking to upgrade the version of PowerBuilder, not
> event to 8.0.4.)
>
>
> I have been trying variations of this for three days. To get
> this code out to the testers I will try some hack of a
> work-around.