1. Sanjay Shivade
  2. PowerBuilder
  3. Friday, 11 January 2019

Hi,

I am in the process of evaluating migration of our PB 9.0.2 code to PB 2017 version of yours. My 4K lines of code have weird issue with Try and Catch. As per Migration assistant the details are as follows. Could you review the code and point us in the right direction? Syntactically it's matching with your 2017 Help file so I feel this might be product defect. I will really appreciate your help. 

 

Lines: 

try

end try

public function integer getinboxcount ();try

Searchfun

try

replacefun

New Reserved Syntax

The code of one of the functions having this issue is as follows for your reference:

is_featureobjectname = Message.StringParm

TRY

n_crystalreport_exception ln_crystalreport_exception
ln_crystalreport_exception = CREATE n_crystalreport_exception

If IsNull(is_featureobjectname ) or pos(lower(trim(is_featureobjectname)),".rpt") < 1 Then
ln_crystalreport_exception.setMessage("Invalid Feature ObjectName")
throw ln_crystalreport_exception
End If

in_crystalreport_base.getCrystalReport(is_featureobjectname)

CATCH (n_crystalreport_exception ne)
MessageBox("Crystal Report Exception", ne.getMessage(), StopSign!)
return false
END TRY

return true

 

Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Hi Sanjay;

    Yes, the Migration Assistant has a"bug" in it when it comes to the TRY..CATCH statements. This command should not be flagged. Here is what it did on my Test App ...

However, the App migrated and ran OK. Just ignore the TRY..CATCH error.

Note: You would get errors when migrating your PB App to PowerServer as the TRY..CATCH is not supported in PowerServer Web/Mobile applications. This would be reported in the PS Code Analysis report.

HTH

Regards ... Chris

Comment
There are no comments made yet.
  1. 2 days ago
  2. PowerBuilder
  3. # 1
Sanjay Shivade Accepted Answer Pending Moderation
0
Votes
Undo

As I recall, it took 20 minutes to migrate all targets but resulted in 3000 lines of code having issues with try and catch.

 

 

Comment
There are no comments made yet.
  1. 2 days ago
  2. PowerBuilder
  3. # 2
Sanjay Shivade Accepted Answer Pending Moderation
0
Votes
Undo

As per migration assistant:

 

Searchfun

try

replacefun

New Reserved Syntax

 

However I do not see any issue with the try catch implementation. What could be the problem? Thanks!

 

Comment
There are no comments made yet.
  1. 2 days ago
  2. PowerBuilder
  3. # 3
Sanjay Shivade Accepted Answer Pending Moderation
0
Votes
Undo

Yes the migration assistant is the one which says 'New Reserved Syntax' for Try-Catch. Am I confused here?

Comment
There are no comments made yet.
  1. 2 days ago
  2. PowerBuilder
  3. # 4
Roland Smith Accepted Answer Pending Moderation
0
Votes
Undo

Have you tried migrating the code?

Comment
There are no comments made yet.
  1. 3 days ago
  2. PowerBuilder
  3. # 5
Sanjay Shivade Accepted Answer Pending Moderation
0
Votes
Undo

Another example with (Runtimerror ex)

TRY

io_wfxsession.rowcount = theGlobals.il_NumberOfItemsLimit

io_wfxinbox = io_wfxsession.Agenda(4)
il_Inboxcount = io_wfxinbox.count

return il_Inboxcount

CATCH (runtimeerror re)
ib_LinkFailure = TRUE
RETURN 0
END TRY

Comment
There are no comments made yet.
  1. 5 days ago
  2. PowerBuilder
  3. # 6
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.