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.

PB is running scripts in design mode when object is redrawn

11 posts in Powerscript Last posting was on 2010-07-01 07:36:37.0Z
jason Posted on 2010-06-28 14:54:31.0Z
From: "Jason" <jbays@wynalda.com>
Newsgroups: sybase.public.powerbuilder.powerscript
Organization: 64.255.64.66
X-Newsreader: AspNNTP 1.50 (JodoHost)
Subject: PB is running scripts in design mode when object is redrawn
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c28b7a7$1@forums-1-dub>
Date: 28 Jun 2010 07:54:31 -0700
X-Trace: forums-1-dub 1277736871 10.22.241.152 (28 Jun 2010 07:54:31 -0700)
X-Original-Trace: 28 Jun 2010 07:54:31 -0700, vip152.sybase.com
Lines: 35
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27404
Article PK: 761844

Here's one I've never seen before.

I open my workspace in Powerbuilder and then open a window. Then I try to right
click on a datawindow so I can edit the script in one of the datawindow's
events. Before the pop up menu is displayed, a PowerScript function I wrote
(dbConnect()) gets called. Note that I'm not running a PB app. I'm working in
the window painter. Also, the script that is being called is not an EXE, it's a
function in one of the PBLs in the workspace.

I edited the function dbConnect(), added a message box and saved the function
object. The next time I right clicked on the datawindow that message box was
displaced so it was calling that function from my current library.

In fact, the dbConnect() function gets called everytime PB trys to redraw the
datawindow. For example, it is called when I show or hide any of the panes in
the window painter.

Now, if I hide the datawindow (uncheck the visible box), I can then show and
hide panes without dbConnect() being called.

I did not change my code between Saturday night when it worked fine and today,
but obviously something happened.

I've rebooted the PC, recompiled the app. We've also tested the PBLs on another
PC and are able to reproduce the issue.

Any ideas?

I'm running PowerBuilder version 10.5.2 Build 7699.

Thanks,

Jason
---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp


Chris Pollach Posted on 2010-06-28 15:57:49.0Z
Sender: 47f9.4c28881b.1804289383@sybase.com
From: Chris Pollach
Newsgroups: sybase.public.powerbuilder.powerscript
Subject: Re: PB is running scripts in design mode when object is redrawn
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4c28c67d.5a10.1681692777@sybase.com>
References: <4c28b7a7$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 28 Jun 2010 08:57:49 -0700
X-Trace: forums-1-dub 1277740669 10.22.241.41 (28 Jun 2010 08:57:49 -0700)
X-Original-Trace: 28 Jun 2010 08:57:49 -0700, 10.22.241.41
Lines: 49
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27405
Article PK: 761846

Hi Jason;

The only time I have seen this in PB is when the DC has a
DW object in it that is RichText based.

Regards ... Chris

> Here's one I've never seen before.
>
> I open my workspace in Powerbuilder and then open a
> window. Then I try to right click on a datawindow so I
> can edit the script in one of the datawindow's events.
> Before the pop up menu is displayed, a PowerScript
> function I wrote (dbConnect()) gets called. Note that I'm
> not running a PB app. I'm working in the window painter.
> Also, the script that is being called is not an EXE, it's
> a function in one of the PBLs in the workspace.
>
> I edited the function dbConnect(), added a message box and
> saved the function object. The next time I right clicked
> on the datawindow that message box was displaced so it was
> calling that function from my current library.
>
> In fact, the dbConnect() function gets called everytime PB
> trys to redraw the datawindow. For example, it is called
> when I show or hide any of the panes in the window
> painter.
>
> Now, if I hide the datawindow (uncheck the visible box), I
> can then show and hide panes without dbConnect() being
> called.
>
> I did not change my code between Saturday night when it
> worked fine and today, but obviously something happened.
>
> I've rebooted the PC, recompiled the app. We've also
> tested the PBLs on another PC and are able to reproduce
> the issue.
>
> Any ideas?
>
> I'm running PowerBuilder version 10.5.2 Build 7699.
>
> Thanks,
>
> Jason
> ---== Posted via the PFCGuide Web Newsreader ==---
> http://www.pfcguide.com/_newsgroups/group_list.asp


jason Posted on 2010-06-28 17:29:24.0Z
From: "Jason" <jbays@wynalda.com>
Newsgroups: sybase.public.powerbuilder.powerscript
Organization: 64.255.64.66
References: <4c28b7a7$1@forums-1-dub> <4c28c67d.5a10.1681692777@sybase.com>
X-Newsreader: AspNNTP 1.50 (JodoHost)
Subject: Re: PB is running scripts in design mode when object is redrawn
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c28dbf4$1@forums-1-dub>
Date: 28 Jun 2010 10:29:24 -0700
X-Trace: forums-1-dub 1277746164 10.22.241.152 (28 Jun 2010 10:29:24 -0700)
X-Original-Trace: 28 Jun 2010 10:29:24 -0700, vip152.sybase.com
Lines: 12
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27406
Article PK: 793737

I solved the issue by making a copy of the original window. I was able to
recreate the issue in the copied window. Then I loaded both windows at the same
time in PB. I then deleted the problem datawindow in the original window. All
of a sudden the issue went away in copy window, even without saving the original
window.

I then saved the original window and closed it. My copy window still worked
fine so I did a SaveAs with the copy window and used it to replace the original.
I closed and reopened the newly saved window. It works fine now.

The only other thing that changed was Ray the janitor came in to empty the
trash...could have been that I guess.


jason Posted on 2010-06-28 17:56:02.0Z
From: "Jason" <jbays@wynalda.com>
Newsgroups: sybase.public.powerbuilder.powerscript
Organization: 64.255.64.66
References: <4c28b7a7$1@forums-1-dub> <4c28c67d.5a10.1681692777@sybase.com> <4c28dbf4$1@forums-1-dub>
X-Newsreader: AspNNTP 1.50 (JodoHost)
Subject: Re: PB is running scripts in design mode when object is redrawn
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c28e232@forums-1-dub>
Date: 28 Jun 2010 10:56:02 -0700
X-Trace: forums-1-dub 1277747762 10.22.241.152 (28 Jun 2010 10:56:02 -0700)
X-Original-Trace: 28 Jun 2010 10:56:02 -0700, vip152.sybase.com
Lines: 5
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27408
Article PK: 761845

Nevermind...that didn't fix it. I forgot I had issued a Return at the start of
the dbConnect() function which was getting called. So it's still getting
called, it just wasn't erroring out.


Jason 'Bug' Fenter [TeamSybase] Posted on 2010-06-28 18:32:42.0Z
From: "Jason 'Bug' Fenter [TeamSybase]" <jason.fenter@teamsybase.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.1
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.powerscript
Subject: Re: PB is running scripts in design mode when object is redrawn
References: <4c28b7a7$1@forums-1-dub> <4c28c67d.5a10.1681692777@sybase.com> <4c28dbf4$1@forums-1-dub> <4c28e232@forums-1-dub>
In-Reply-To: <4c28e232@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c28eaca$1@forums-1-dub>
Date: 28 Jun 2010 11:32:42 -0700
X-Trace: forums-1-dub 1277749962 10.22.241.152 (28 Jun 2010 11:32:42 -0700)
X-Original-Trace: 28 Jun 2010 11:32:42 -0700, vip152.sybase.com
Lines: 16
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27409
Article PK: 793745

As Chris hinted: do a full build; optimize your pbls; do another full build.

You might also try editing the source for the window to see if anything
looks out of place. I know that any code in the CREATE event for the
window (not the constructor, the CREATE) will get executed when you open
the window in the painter.

On 6/28/2010 12:56 PM, Jason wrote:
> Nevermind...that didn't fix it. I forgot I had issued a Return at the start of
> the dbConnect() function which was getting called. So it's still getting
> called, it just wasn't erroring out.
>
>


Chris Pollach Posted on 2010-06-29 00:08:26.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.powerscript
References: <4c28b7a7$1@forums-1-dub> <4c28c67d.5a10.1681692777@sybase.com> <4c28dbf4$1@forums-1-dub> <4c28e232@forums-1-dub> <4c28eaca$1@forums-1-dub>
In-Reply-To: <4c28eaca$1@forums-1-dub>
Subject: Re: PB is running scripts in design mode when object is redrawn
Lines: 1
Organization: STD Inc.
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c29397a$1@forums-1-dub>
Date: 28 Jun 2010 17:08:26 -0700
X-Trace: forums-1-dub 1277770106 10.22.241.152 (28 Jun 2010 17:08:26 -0700)
X-Original-Trace: 28 Jun 2010 17:08:26 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27410
Article PK: 793738

Yes, Jason has an excellent point. I have gotten caught before in a corrupt
object (p-code) and / or PBL. If the regen + optimize does not work - try
creating a new PBL and export / import the object's source code. Then see if
the problem goes away. If that does not work, you may need to review the
object's affect source code. The very odd time I have found double
constructors, missing events, over-ride code that should not be there, etc.

"Jason 'Bug' Fenter [TeamSybase]" <jason.fenter@teamsybase.com> wrote in
message news:4c28eaca$1@forums-1-dub...
> As Chris hinted: do a full build; optimize your pbls; do another full
> build.
>
> You might also try editing the source for the window to see if anything
> looks out of place. I know that any code in the CREATE event for the
> window (not the constructor, the CREATE) will get executed when you open
> the window in the painter.
>
>
>
>
> On 6/28/2010 12:56 PM, Jason wrote:
>> Nevermind...that didn't fix it. I forgot I had issued a Return at the
>> start of
>> the dbConnect() function which was getting called. So it's still getting
>> called, it just wasn't erroring out.
>>
>>


jason Posted on 2010-06-29 12:17:01.0Z
From: "Jason" <jbays@wynalda.com>
Newsgroups: sybase.public.powerbuilder.powerscript
Organization: 64.255.64.66
References: <4c28b7a7$1@forums-1-dub> <4c28c67d.5a10.1681692777@sybase.com> <4c28dbf4$1@forums-1-dub> <4c28e232@forums-1-dub> <4c28eaca$1@forums-1-dub> <4c29397a$1@forums-1-dub>
X-Newsreader: AspNNTP 1.50 (JodoHost)
Subject: Re: PB is running scripts in design mode when object is redrawn
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c29e43d@forums-1-dub>
Date: 29 Jun 2010 05:17:01 -0700
X-Trace: forums-1-dub 1277813821 10.22.241.152 (29 Jun 2010 05:17:01 -0700)
X-Original-Trace: 29 Jun 2010 05:17:01 -0700, vip152.sybase.com
Lines: 9
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27411
Article PK: 761849

Thanks for the suggestions guys. The regen and optimize didn't work. I'll look
into the source code for issues.

At this point it's hard to isolate the problem. I found another window that has
the same issue. They both have the same datawindow userobject, but not all
windows with that datawindow UO have the problem.

I also went back to backup PBLs from 2 weeks ago. I created a new workspace and
loaded the PBLs in. The same problem appeared. How is that possible?


jason Posted on 2010-06-29 18:45:18.0Z
From: "Jason" <jbays@wynalda.com>
Newsgroups: sybase.public.powerbuilder.powerscript
Organization: 64.255.64.66
References: <4c28b7a7$1@forums-1-dub> <4c28c67d.5a10.1681692777@sybase.com> <4c28dbf4$1@forums-1-dub> <4c28e232@forums-1-dub> <4c28eaca$1@forums-1-dub> <4c29397a$1@forums-1-dub> <4c29e43d@forums-1-dub>
X-Newsreader: AspNNTP 1.50 (JodoHost)
Subject: Re: PB is running scripts in design mode when object is redrawn
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c2a3f3e$1@forums-1-dub>
Date: 29 Jun 2010 11:45:18 -0700
X-Trace: forums-1-dub 1277837118 10.22.241.152 (29 Jun 2010 11:45:18 -0700)
X-Original-Trace: 29 Jun 2010 11:45:18 -0700, vip152.sybase.com
Lines: 28
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27412
Article PK: 793735

Ok. I found the issue and a solution. First the issue.

I was able to find other windows in my application that would generate the same
issue. The one thing they had in common is they all contained datawindows that
contained a PowerScript function object call in either an expression or a
computed field. What was happening is these function calls were being triggered
when the datawindow would be redrawn and the functions referenced dbConnect()
which is generating errors.

dbConnect( arg_trans TRANSACTION ) is passed in a transaction as a parameter.
There is a line in the function that checks to see if arg_trans isValid(). I
found that when the workspace painters were triggering the functions in the
datawindows to call dbConnect(), that arg_trans was not valid and additional
scripts were run and error messages were displayed. Why this started happening
all of a sudden I'm not sure.

Now for the solution.

I added the following lines to the beginning of dbConnect():

app_this = GetApplication()
s_temp = app_this.AppName

I found that when app_this.AppName is reached, the processing of the script
appears to stop when it's executed in the workspace and I don't get any error
messages. It works fine as you would expect when it's processed during runtime.

There you have it. Thanks for the suggestions.


Chris Pollach Posted on 2010-06-30 01:29:53.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.powerscript
References: <4c28b7a7$1@forums-1-dub> <4c28c67d.5a10.1681692777@sybase.com> <4c28dbf4$1@forums-1-dub> <4c28e232@forums-1-dub> <4c28eaca$1@forums-1-dub> <4c29397a$1@forums-1-dub> <4c29e43d@forums-1-dub> <4c2a3f3e$1@forums-1-dub>
In-Reply-To: <4c2a3f3e$1@forums-1-dub>
Subject: Re: PB is running scripts in design mode when object is redrawn
Lines: 1
Organization: STD Inc.
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c2a9e11@forums-1-dub>
Date: 29 Jun 2010 18:29:53 -0700
X-Trace: forums-1-dub 1277861393 10.22.241.152 (29 Jun 2010 18:29:53 -0700)
X-Original-Trace: 29 Jun 2010 18:29:53 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.powerscript:27413
Article PK: 761848

Excellent detective work Mr Holmes!

"Jason" <jbays@wynalda.com> wrote in message news:4c2a3f3e$1@forums-1-dub...
> Ok. I found the issue and a solution. First the issue.
>
> I was able to find other windows in my application that would generate the
> same
> issue. The one thing they had in common is they all contained datawindows
> that
> contained a PowerScript function object call in either an expression or a
> computed field. What was happening is these function calls were being
> triggered
> when the datawindow would be redrawn and the functions referenced
> dbConnect()
> which is generating errors.
>
> dbConnect( arg_trans TRANSACTION ) is passed in a transaction as a
> parameter.
> There is a line in the function that checks to see if arg_trans isValid().
> I
> found that when the workspace painters were triggering the functions in
> the
> datawindows to call dbConnect(), that arg_trans was not valid and
> additional
> scripts were run and error messages were displayed. Why this started
> happening
> all of a sudden I'm not sure.
>
> Now for the solution.
>
> I added the following lines to the beginning of dbConnect():
>
> app_this = GetApplication()
> s_temp = app_this.AppName
>
> I found that when app_this.AppName is reached, the processing of the
> script
> appears to stop when it's executed in the workspace and I don't get any
> error
> messages. It works fine as you would expect when it's processed during
> runtime.
>
> There you have it. Thanks for the suggestions.