1. Berka Frenfert
  2. PowerBuilder
  3. Sunday, 30 April 2023 13:53 PM UTC

Please read latest crash report posted on Tuesday, 27 February 2024 below in reply section.


NOTE: This one is older but almost same kind of TRY CATCH

Hi,

I know referenced DW does not have instance variable i am trying to set so obviously PB will crash. But even after TRY CATCH, PB is crashing exactly at the same line.

In a window some DWs are UO and some are simple DW controls. UOs have an instance variable i can set but standard DW controls have no instance variable declared. A loop on window control array picks every UO and DW and set the instance variable.

I thought TRY CATCH would not let PB crash on runtime error but look like PB is not kind of "Power Builder" that let things go so easily. Right where i try to set instance variable, "Power Builder" beating crap out of me.

Is there any kind of apology Power Builder might accept and let me go see doctor?

True regards,

Berka

Accepted Answer
Berka Frenfert Accepted Answer Pending Moderation
  1. Wednesday, 27 March 2024 10:58 AM UTC
  2. PowerBuilder
  3. # Permalink
btw, something was wrong not with code but with PB itself. i had no other idea except to reinstall PB and this solved the issue earlier. I will keep this in my mind to use the combination of both. for now i just close this issue as solved. Thank you so much. Im sorry for late response , i was not using computer.
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 27 February 2024 21:34 PM UTC
  2. PowerBuilder
  3. # 1

Hi Berka;

  FWIW: That is why I never use DOT Notation. Instead, I use for example either a Describe() or Modify() commands as they don't create any exceptions (what we call a "soft" fail)! Instead, they always return a status that you can check.  ;-)

  In your case for a data copy operation ... I would use either a RowsCopy() or ShareData() command instead.Then just check the Returned "Completion"  Code.   HTH

Regards .. Chris

 

Comment
  1. Berka Frenfert
  2. Wednesday, 28 February 2024 09:04 AM UTC
Hi Chris,

Thats true, loops are functions have their own advantages. For me DOT operator is very simple solution but without protection of TRY CATCH the little dot is always at risk.



I solved the crash problem by checking columns, their types and sequence before assigning data from DS to DW.



I like it and use it :)

dataDW.Object.data = dataDS.object.data



My habbit made me use TRY CATCH at many places even SetItem and GetItem were replaced with DOT.



Sometimes i do want to know why TRY CATCH isnt working but i know i will be using some workround.



PowerBuilder is leaving enough time for me to look arround and get involved in other technologies. Sometimes i think if PowerBuilder dont help me to create web/mobile apps that i can create with reactive frameworks then time gap will keep increasing. And one day i think i will forget my account password too.



Well, glad to have your response.



True regrads,

Berka
  1. Helpful
  1. Berka Frenfert
  2. Friday, 8 March 2024 06:54 AM UTC
Hi Chris, this expression cause crash on a DW that has blob column in it. i could not find any function that return true on bolob column existance in a dw. So, i checked all other ColType and skipped the one that was unknown (blob). It happened yesterday, i did not know modify can cause crash. Please check this.



dw.Modify("#" + String(Row) + ".TabSequence=0")
  1. Helpful
  1. Arnd Schmidt
  2. Friday, 8 March 2024 08:43 AM UTC
Hi Berka,

is row a correct value for setting the tabsequence of a column, usually identified by a column id (number) or the column name?!

But anyway, that should raise a soft error.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 27 February 2024 21:34 PM UTC
  2. PowerBuilder
  3. # 2

Hi Berka;

  FWIW: That is why I never use DOT Notation. Instead, I use for example either a Describe() or Modify() commands as they don't create any exceptions (what we call a "soft" fail)! Instead, they always return a status that you can check.  ;-)

  In your case for a data copy operation ... I would use either a RowsCopy() or ShareData() command instead.Then just check the Returned "Completion"  Code.   HTH

Regards .. Chris

 

Comment
There are no comments made yet.
Berka Frenfert Accepted Answer Pending Moderation
  1. Tuesday, 27 February 2024 11:38 AM UTC
  2. PowerBuilder
  3. # 3

PB Crash Here:: dw_pb_report.Object.data = dataDS.object.data

Reason:: something mismatch in both dataObjects.

I want:: to ignore whatever is the reason but i guess following is not the right way to request.


Boolean Temp = FALSE

TRY
    dw_pb_report.Reset()
    TRY
        dw_pb_report.Object.data = dataDS.object.data
    CATCH(Throwable TAE001)
    END TRY
    Temp = Temp
CATCH(RuntimeError RTE001)
END TRY

Question:: Do I need to check dataobjects in my code for any mismatch and bypass the line where PB crashs or there is way to avoid crash?

Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Sunday, 30 April 2023 21:11 PM UTC
  2. PowerBuilder
  3. # 4

Are you catching RuntimeError?  If not what are you catching?  I'd try RuntimeError if you're not.  I have noticed that the Appeon versions don't seem to catch all errors like prior versions seemed to.  You should report it as a bug and see what Appeon says.

Comment
  1. Berka Frenfert
  2. Monday, 1 May 2023 07:37 AM UTC
If an invalid reference cause RuntimeError then yes that is what i wanted to check. I want No-Crash-At-All kind of IDE. I believe the best IDE is that leaves no sign/chance/event of crash at anytime and also no error is severe enough to crash whole thing at once leaving developer helpless.



Oh, Glad to have response from you otherwise i was thinking perhaps i am the Error that PowerBuilder caught finally.



Please see if you get the same error.



True Regards,

Berka
  1. Helpful
  1. Benjamin Gaesslein
  2. Tuesday, 2 May 2023 06:18 AM UTC
Well, what *does* your catch block look like? To catch runtime errors, you have to use either catch( runtimeerror e ) or catch ( throwable t ). The latter will include both runtime errors and exceptions.
  1. Helpful
  1. Berka Frenfert
  2. Thursday, 11 May 2023 10:11 AM UTC
Yes,

TRY

.... something too bad

CATCH( RuntimeError RTE0001)

END TRY



Almost everywhere same block is used.I did not know that latter will use both. i have to check again my code with addition of ( throwable T) as well. Thank you
  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.