1. Fernando Leal
  2. PowerBuilder
  3. Wednesday, 21 October 2020 18:19 PM UTC

Hi All, 

We need your help, please.

We have a problem when call the timer in PB2019 R2, the timer return "-1" state , Do you no know what is the problem and the solution?

 

Code

int li_log_timer
li_log_timer = timer(ide_timer_seg, w_pesado_proceso_balanza_tercero)

li_log_timer = -1 (this is the return state)

 

thanks and regards,

Fernando.

Alonso Cervantes Accepted Answer Pending Moderation
  1. Wednesday, 16 December 2020 18:36 PM UTC
  2. PowerBuilder
  3. # 1

Hello

I am having the same issue, My app that sends emails, I'm using the timer event of the window to call a function that retrieves info from database and sends emails, this app was working perfectly in PB 2019 R1, I updated PB2019 to R2 build 2353 and my app stop working on the pc's that has been deployed, the timer event of the window never fires, and I cannot replicate in design mode because it works fine.

Fernando, would you tell me what did you do to solve this? / Me podria decir que hizo para resolver este problema?.

 

Gracias, apreciaria mucho su ayuda!

Alonso

 

 

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 16 December 2020 21:45 PM UTC
Hi guys ... FWIW: you should be using PB's built-in "Timing" object class for that type of application (see the PB Help).
  1. Helpful
  1. Alonso Cervantes
  2. Wednesday, 16 December 2020 22:07 PM UTC
Chris,



That's what I'm being using,I founded out that the problem has to be with PB's Runtime, I have uninstalled and deleted all trace of PB 11.5 and PB2019 R1 Runtimes and Reinstalled PB 2019 R2 Runtime and finally worked!.



Thanks for your reply.



Alonso



  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 17 December 2020 18:16 PM UTC
Hi Alonso;

Ahhhh.... a comnon mistake that many PB developers have made throughout PB's many releases. When you install more that one PB version, you need to make sure that you check your O/S's "System Path" after the installation process to make sure that the higher PB Version is *first* in the library path. Most PB runtime DLL's are numbered but some are not. Typically, these non-numbered runtime DLL's are downward compatible at runtime but *not* upward compatible. If a higher PB version App picks up a lower non-numbered DLL at runtime, the App may not behave properly (as you are now experiencing). HTH

Regards ... Chris
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Thursday, 22 October 2020 00:43 AM UTC
  2. PowerBuilder
  3. # 2

POST the call to the timer from the OPEN event.

Olan

Comment
  1. Miguel Leeuwe
  2. Thursday, 22 October 2020 14:36 PM UTC
Don't know about that Olan. If his 'delay' on the open event to finish is DB related or a user has a slower computer, on a "bad" day the 1 or 2 seconds timer start failing again. The best thing is your POST to call the timer.

2cts.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 22 October 2020 14:39 PM UTC
Hi Miguel ... correct, the Window is probably still completing its instantiation processing when the 1st timer event tries to fire. Thus, a processing conflict occurs.

FWIW: I have never used the Open event to initialize Window processing for over two decades now. I have always used a PostOpen user event for that. I would hardily recommend this approach for all PB Apps. This has saved my PB Apps from being sensitive to changes in event order processing changes - which has been an ongoing challenge since even way back into the PowerSoft days of PB. ;-)
  1. Helpful
  1. Fernando Leal
  2. Friday, 23 October 2020 14:39 PM UTC
Hi All,

I have created an event and call the Timer from the button and it works fine.

From my PC, which is where I develop the application, the Timer works either from the PBL or PBD.

On the PC where I copy the PDBs, which is a windows 10, the timer doesn't work and I don't know why this never happened to me or I saw it.

thanks and regards,

Fernando

  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 21 October 2020 18:47 PM UTC
  2. PowerBuilder
  3. # 3

Hi, Fernando -

(1) What is the value of ide_timer_seg? Can you temporarily replace this variable reference with an equivalent hard-coded constant, such as 10, for example?

(2) Is the global reference variable w_pesado_proceso_balanza_tercero valid? It may or may not be valid depending on the coding technique used to open the window. I suggest you precede the Timer function call with an IsValid(w_pesado_proceso_balanza_tercero) function call in an If statement. For example:

If IsValid(w_pesado_proceso_balanza_tercero) Then
   li_rc = Timer(10,w_pesado_proceso_balanza_tercero)
Else
   MessageBox('Oops!','The window reference variable is not valid.')
End if

Regards, John

Comment
  1. Fernando Leal
  2. Wednesday, 21 October 2020 19:02 PM UTC
Hi John,

We change the code, the problem is the timer never run. We don´t Know why is the problem.

This code is in Windows Open event.

int li_log_timer

li_log_timer =timer(0.3)



thanks and regards,

Fernando.



  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 21 October 2020 18:47 PM UTC
  2. PowerBuilder
  3. # 4

Hi Fernando;

  Typically, this occurs when ...

1) First argument is negative value

2) Second argument is not a valid window pointer

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Monday, 26 October 2020 17:08 PM UTC
Hi Fernando;

I cannot replicate this timer issue on my R2 test App EXE's on W10.

I am using PB2019 R2 build 2353

Regards ... Chris
  1. Helpful
  1. Fernando Leal
  2. Tuesday, 27 October 2020 19:57 PM UTC
Hi Chris, this issue was solved because I am using no visual object Timing.

thanks and regards,

Fernando.

  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 16 December 2020 20:32 PM UTC
Hi Fernando .. that is "awesome" news & thanks for the feedback! :-)
  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.