1. William Beale
  2. PowerBuilder
  3. Friday, 26 October 2018 01:51 AM UTC

When debugging or running an executable of my application, if an array bound is exceeded, or a Get- or Set-Item is effected and there is a problem with the row number or incorrect spelling of the column name, the application freezes at these points.

This also occurred in ver PB12.6.

Prior to that, if such a glitch was encountered, I’d get an ‘array bound exceeded’ or row count/column error. 

Now the application just freezes. 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 29 October 2018 13:56 PM UTC
  2. PowerBuilder
  3. # 1

Hi William;

   I tried your simple Array test code with my STD framework and it caught it properly (coded in the OK button), as follows:

 

No TRY..CATCH - handled in SystemError event:

 

With TRY..CATCH - The Beep sounds and processing continues

// ** CIPTEST **
string ls_a[ ]
Try
    IF  ls_a[10] = 'test'  Then
    END IF
catch ( RuntimeError  lo_ex )
    Beep (1)
end try
// ** CIPTEST **

 

Just a guess, but I am starting to think that the issue is with the PFC (or its use thereof).

Regards ... Chris

 

 

 

 

 

Comment
  1. William Beale
  2. Tuesday, 30 October 2018 00:23 AM UTC
Thanks again Chris. I'll keep exploring with the n_cst_error and the like. From what I can see so far, no code changes have been made to these events. The pfc_system_error, being ancient code, varies only slightly in the error message configuration to more recent pfc code.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 30 October 2018 01:15 AM UTC
Did you update the PFC layer version with the one that matches your PB version or is this an old PFC version that has just migrated forward again and again?
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Friday, 26 October 2018 22:35 PM UTC
  2. PowerBuilder
  3. # 2

Can you post your code, please?

Thanks,
Olan

Comment
  1. William Beale
  2. Friday, 26 October 2018 23:48 PM UTC
Hi Olan,



This is contrived code to force an array bound being exceeded - same freezing problem with or without the TRY / CATCH.



The freezing also occurs with an Set or Get Item for a datawindow/store row if the row or column-name is in error.



The code under is the pfc_SystemError even in the application manager ....





string ls_a[]



TRY

If ls_a[10] = 'test' Then

li_rc = 1

End If



CATCH (Exception exception)

RETURN -1

END TRY





//////////////////////////////////////////////////////////////////////////////

//

// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.

// Any distribution of the PowerBuilder Foundation Classes (PFC)

// source code by other than Sybase, Inc. and its subsidiaries is prohibited.

//

//////////////////////////////////////////////////////////////////////////////

string ls_message

string ls_msgparm[1]



ls_message = 'Error Number '+string(error.number) &

+'.~r~nError text = '+Error.text &

+'.~r~nWindow/Menu/Object = '+error.windowmenu &

+'.~r~nError Object/Control = '+Error.object &

+'.~r~nScript = '+Error.objectevent &

+'.~r~nLine in Script = '+string(Error.line) + '.'



if isvalid(inv_error) then

ls_msgparm[1] = ls_message

inv_error.of_message('pfc_systemerror', ls_msgparm)

else

messagebox('System Error',ls_message, StopSign!, Ok!)

end if



this.event pfc_exit()
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 26 October 2018 13:31 PM UTC
  2. PowerBuilder
  3. # 3

Hi William;

   I still get those errors on an array boundary issue or a Get/Set within a DC/DS, in PB2017R3.

   For the App EXE getting these type of things, I would normally ask if you had the correct run-time installed that matches your App compile. However, this is most extraordinary coming from the IDE.

   For the DC/DS, I wonder if its something that you are trying to handle in their ERROR event that's causing the issue? I am not sure what to suggest though on a simple array boundary other that (unless you have a TRY..CATCH around that code), it should fire the SystemError event. Again, if you have code there, maybe its trying to handle that error condition with your PowerScript code that's causing the issue.

Food for thought.

HTH

Regards ... Chris

Comment
  1. William Beale
  2. Friday, 26 October 2018 22:16 PM UTC
Thanks again for your interest, Chris.

I put a TRY CATCH around a contrived array bound error, and a breakpoint in the (unedited) pfc_SystemError event of the app manager.

The step-through still froze within the TRY/CATCH on the array bound error. The pfc_systemerror event did not fire.

My only other observation was that the local variable tab pane under the code went blank when the error row 'freeze' occurred. The same occurs on my test machine.

I should also add the pfc_library remains the same back to our original use of PB - copyright date 1996-1997 in the pfc_systemerror event.

  1. Helpful
  1. William Beale
  2. Saturday, 27 October 2018 23:17 PM UTC
Mulling this over, should there be a 'system error' even - an original event ex-pfc_system_error? The only system error event I can find in my configuration is the pfc_system_error.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.