1. Chris Lerwill
  2. PowerServer
  3. Wednesday, 19 April 2023 17:28 PM UTC

Most of my career I have had to maintain some other developer(s) code.  With that in mind, I attempt to follow PowerBuilder's documented approaches for all the code I write.  I have, however, seen code like what is shown below that works in a client/server application.  Because the code works and I have to prioritize improvements/fixes, I practice the motto:  If it ain't broke, don't fix it.

In a PowerServer application, however, I am finding that code like what is seen below occasionally crashes the application.  Specifically, the RETRIEVE syntax.

if not a_exitscript then
	i_stopnum% = GetItemNumber ( dw_lookup, 1, "number" )
	Retrieve ( dw_det, "", i_stopnum%, "STOPS" )
end if

 

I have discovered that the fix is to, instead, have the syntax look like this...

if not a_exitscript then
	i_stopnum% = GetItemNumber ( dw_lookup, 1, "number" )
	dw_det.Retrieve( "", i_stopnum%, "STOPS" )
end if

 

Finally my question(s): 

  1. Is something like what I described above not working in PowerServer because it is attempting to enforce better practices? 
  2. I haven't dug-up any of my old PowerBuilder books, but does the original syntax work in a client/server application because it was allowed in an early version of PowerBuilder and now it is being tolerated by the compiler to allow backward compatibility?
  3. Is this an issue in PowerServer I should report?

 

Thanks for any input/advice.

 

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 19 April 2023 17:44 PM UTC
  2. PowerServer
  3. # Permalink

That looks like pre-PB5 syntax.

Comment
  1. mike S
  2. Wednesday, 19 April 2023 21:36 PM UTC
yeah, i'm not surprised it doesn't work in powerserver. it's not even in the documentation anymore. At some point it probably will be removed.



I would have thought there would be warnings about it being obsolete syntax
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.