Red de conocimiento informático - Aprendizaje de código fuente - ¿Código para suma y resta de tiempo?

¿Código para suma y resta de tiempo?

; código fuente de AutoIt

#include lt;ButtonConstants.au3gt;

#include lt;DateTimeConstants.au3gt;

#include lt;EditConstants.au3gt;

#include lt;GUIConstantsEx.au3gt;

#include lt;WindowsConstants.au3gt;

#include lt;Date.au3gt;

#NoTrayIcon

#Región ### INICIO de la sección GUI de Koda ### Form=

$Form1 = GUICreate("Calculadora de suma y resta de tiempo", 392, 246, 192, 114)

$ Fecha1 = GUICtrlCreateDate("", 40, 40, 80, 30, $DTS_TIMEFORMAT)

$Input1 = GUICtrlCreateInput("95", 200, 45, 60, 25)

$Radio1 = GUICtrlCreateRadio("menos", 48, 104, 33, 17)

GUICtrlSetState($Radio1, $GUI_CHECKED)

$Radio2 = GUICtrlCreateRadio("más", 112, 104, 33, 17)

$Fecha2 = GUICtrlCreateDate("", 40, 160, 80, 30, $DTS_TIMEFORMAT)

$Botón1 = GUICtrlCreateButton("Calcular", 200, 104, 73, 33)

GUISetState(@SW_SHOW)

#EndRegion ### FIN sección de la GUI de Koda ###

$t1 = ""

$t2 = ""

$sign = -1

Mientras 1

$nMsg = GUIGetMsg()

Cambiar $nMsg

Caso $GUI_EVENT_CLOSE

Salir

Caso $Button1

Si "" = GUICtrlRead($Input1) Entonces

MsgBox(16, "Error", "Ingrese la diferencia horaria")

De lo contrario

$min = Número( GUICtrlRead($Input1))

$t1 = GUICtrlRead($Date1)

Si $GUI_CHECKED = GUICtrlRead($Radio1) entonces

$sign = - 1

Fin.

1

EndIf

Si $GUI_CHECKED = GUICtrlRead($Radio2) entonces

$sign = 1

EndIf

$t2 = _DateAdd('n', $signo*$min, @YEAR amp; "/" amp; @MON amp; "/" amp; @MDAY amp; " " amp; $t1)

GUICtrlSetData($Date2, $t2)

EndIf

EndSwitch

WEnd