1. MARK APTEKAR
  2. PowerBuilder
  3. Wednesday, 26 April 2023 20:19 PM UTC

Hi, I have PowerBuilder application (2019 R3 build 2703) that is running as service. But lately that program start having issues. Sometimes it runs as service but sometimes it doesn't. I know the reason why program does not run as service; it happens because window object that program is using doesn't 'loads'. Open event of the window object never executed and any other codes as well. I do not know if I ever be able to find the real reason why this problem happens and how long it may take, so I decided remove window object from the program and use NVO instead. The only concern I have, my program is using Timer event of the window to check/execute some codes in the specified interval. As far as I know Timer event is available only for the window object. So, if my program will not have window then how codes that need to be executed in the specified interval will be triggered in that case?  Is there any other 'mechanism' in PowerBuilder that can trigger Timer event without using window object?  What are my options? Thank you in advance for you time and help.

 

Accepted Answer
mike S Accepted Answer Pending Moderation
  1. Wednesday, 26 April 2023 20:24 PM UTC
  2. PowerBuilder
  3. # Permalink

Timing object
"Timing is a nonvisual system object that can be used when a Timer event cannot be associated with a window. To use a timing object, create a standard class user object that inherits from the Timing system class, and then create an instance of the inherited timing object."

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 26 April 2023 21:58 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Mark -

Mike is correct. The Timing object is the way to go.

Look at the PB Help for "Timing object". In particular, look at the Start and Stop functions and the Timer event. The help topic for the Timing object's Start function contains some helpful example code, as does the help topic for the Timer event.

The key point is, as Mike explained, to create a new standard class user object that inherits from the (base) Timing object.

Good luck!

Comment
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.