1. Haakon Langballe
  2. PowerBuilder
  3. Monday, 23 March 2020 14:51 PM UTC

Hi all.

Working from home now. Hope the situation wil get back to normal soon!

In my project I foun a hand crafted critical section (below). It's in a timer callback, to prevent multiple callbacks from entering the funtion.

Is there a construct in Powerbuilder 19 that will do this out of the box? 

 

if not gUpdating then
gUpdating = true
of_get_stuff()
gUpdating = false
end if

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 23 March 2020 20:42 PM UTC
  2. PowerBuilder
  3. # 1

Hi Haakon;

   Unfortunately at this time, PB does not support "call backs". You can workaround this by creating your own C++ (or now C# DLL in PBN2019 R2) and have this "broker" the callback for you.

Regards ... Chris

Comment
  1. Roland Smith
  2. Tuesday, 24 March 2020 02:19 AM UTC
I don't think he is talking about external function callback arguments.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 24 March 2020 14:46 PM UTC
Hi Roland ... Yes, the queston was not very clear. The use of the word "Callback" would infer a different use than handling multiple posts from a timer and/or shared object.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 23 March 2020 17:03 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

You did not explain what gUpdating is, but I assume it's a global (boolean?) variable.

What you can do is a call to:

Timer(0)

right after entering the timer event.

When finished whatever is being done in the timer event, you re-activate the timer with "timer(xxx)", xxx being a non-zero value.

hope that might be what you're looking for.

regards,

Comment
  1. Haakon Langballe
  2. Tuesday, 24 March 2020 08:05 AM UTC
Hi Miguel.

Yes it's a global boolean.

I think your Timer(0) suggestion may be a good solution.



Thanks

Haakon
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 24 March 2020 08:10 AM UTC
yes, just try it.
  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.