Autor Thema: SDT_TO_TOD problem - cast is missing  (Gelesen 8947 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

c3p0

  • Gast
SDT_TO_TOD problem - cast is missing
« am: 10. Februar 2010, 09:01:28 »
Hi,

It seems that the SDT_TO_TOD function is missing a cast. To function properly the .SECOND part of the SDT-structure must be converted to a DINT. The compiler apparently realizes that the other parts must be converted (since they are multiplied by numbers larger than what an INT can hold)...

The correct conversion would be:

SDT_TO_TOD := DINT_TO_TOD(DTI.HOUR * 3600000 + DTI.MINUTE * 60000 + INT_TO_DINT(DTI.SECOND) * 1000 + DTI.MS);

« Letzte Änderung: 11. Februar 2010, 09:44:14 von c3p0 »

dalbi

  • Gast
Re:SDT_TO_TOD problem - cast is missing
« Antwort #1 am: 15. Februar 2010, 20:23:50 »
Hi c3p0,

thank you!  ;)

Greetings Daniel