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.

Closing tab pages

4 posts in Objects Last posting was on 2002-07-15 21:48:45.0Z
venkat Posted on 2002-07-15 18:42:59.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Venkat
Date: Mon, 15 Jul 2002 14:42:59 -0400
Subject: Closing tab pages
Lines: 23
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_2B4973E42E9649220066D02185256BF7.0066D03785256BF7@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:1116
Article PK: 713677

Hi,

I am working with dynamic tab pages in my application.
To start with I have an empty tab control in a window and I add user
objects as tab pages dynamically, using OpenTab function.
Now I try to print "UpperBound(tab_1.control[])" after closing all the tab
pages that I created(CloseTab). Since there are no more tab pages I
expected "UpperBound(tab_1.control[])" to return a 0, instead it returns 1.
The sample code is.

IF UPPERBOUND(tab_1.control[]) > 0 THEN
FOR tabpage = numpages to 1 STEP -1
tab_1.closetab(tab_1.control[tabpage])
NEXT
END IF

MessageBox("info", String(UPPERBOUND(tab_1.control[]))).

In my code I am making decisions based on the
"UpperBound(tab_1.control[])" value of 0, but because of the above
mentioned problem my code fails.

Any suggestions/help is appreciated.


Martin M Eichelman, Jr <no-reply Posted on 2002-07-15 19:09:43.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Martin M Eichelman, Jr <no-reply@strategic-alt.com>
Subject: Re: Closing tab pages
Date: Mon, 15 Jul 2002 12:09:43 -0700
Organization: Strategic Alternatives Inc
X-Newsreader: MicroPlanet Gravity v2.60
Lines: 27
NNTP-Posting-Host: 12.22.218.52
Message-ID: <364_pQF0sQDLCHA.306@forums.sybase.com>
References: <364_2B4973E42E9649220066D02185256BF7.0066D03785256BF7@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1113
Article PK: 713675

Where and how is numpages being set?

:: m a r t y


In article <2B4973E42E9649220066D02185256BF7.0066D03785256BF7
@webforums>, Venkat <Venkat> says...

> Hi,
>
> I am working with dynamic tab pages in my application.
> To start with I have an empty tab control in a window and I add user
> objects as tab pages dynamically, using OpenTab function.
> Now I try to print "UpperBound(tab_1.control[])" after closing all the tab
> pages that I created(CloseTab). Since there are no more tab pages I
> expected "UpperBound(tab_1.control[])" to return a 0, instead it returns 1.
> The sample code is.
>
> IF UPPERBOUND(tab_1.control[]) > 0 THEN
> FOR tabpage = numpages to 1 STEP -1
> tab_1.closetab(tab_1.control[tabpage])
> NEXT
> END IF
>
> MessageBox("info", String(UPPERBOUND(tab_1.control[]))).
>
> In my code I am making decisions based on the
> "UpperBound(tab_1.control[])" value of 0, but because of the above
> mentioned problem my code fails.
>
> Any suggestions/help is appreciated.
>


venkat Posted on 2002-07-15 21:16:14.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Venkat
Date: Mon, 15 Jul 2002 17:16:14 -0400
Subject: Re: Closing tab pages
Lines: 3
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_D96F0B5693C23D360074D7AB85256BF7.006D0B5785256BF7@webforums>
References: <364_2B4973E42E9649220066D02185256BF7.0066D03785256BF7@webforums> <364_pQF0sQDLCHA.306@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:1110
Article PK: 713679

The numpages is set just before that.

numpages = UPPERBOUND(tab_1.control[])


Martin M Eichelman, Jr <no-reply Posted on 2002-07-15 21:48:45.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Martin M Eichelman, Jr <no-reply@strategic-alt.com>
Subject: Re: Closing tab pages
Date: Mon, 15 Jul 2002 14:48:45 -0700
Organization: Strategic Alternatives Inc
X-Newsreader: MicroPlanet Gravity v2.60
Lines: 15
NNTP-Posting-Host: 12.22.218.52
Message-ID: <364_taZekpELCHA.195@forums.sybase.com>
References: <364_2B4973E42E9649220066D02185256BF7.0066D03785256BF7@webforums> <364_pQF0sQDLCHA.306@forums.sybase.com> <364_D96F0B5693C23D360074D7AB85256BF7.006D0B5785256BF7@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1109
Article PK: 713673

Just setup and ran a quick test. This looks like a "feature",
sometimes known as a bug. The last tabpage is destroyed by the
CloseTab call, the tab_1.control[1] value is invalid, but the instance
remains which gives you an UpperBound of 1.

You may need to check:

If UpperBound(tab_1.control) = 1 AND IsValid(tab_1.control[1]) = FALSE
THEN..

:: m a r t y


In article <D96F0B5693C23D360074D7AB85256BF7.006D0B5785256BF7
@webforums>, Venkat <Venkat> says...

> The numpages is set just before that.
>
> numpages = UPPERBOUND(tab_1.control[])
>