voila je vous explique mon problème:
je souhaiterais crée une alarme pour ordinateur qui conciste a calculer l'heure actuel et l'heure que je lui est entree
ex: il est 12h32et14s
moi je met : 12h55et 23s
je souhaiterais savoir comment peut t on calculer la differance qu'il y a entre les deux c'est sur sa que je bloque


voila sur ceux voici un code d'exemple qui pourra surement beaucoup plus vous aidez .
Code : Tout sélectionner
;- Window Constants
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
Enumeration
#Text_0
#Text_1
#Text_2
#Text_3
#Image_0
#String_0
#String_1
#String_2
#Button_0
#Button_1
EndEnumeration
InitSound()
;- Fonts
Global FontID1
FontID1 = LoadFont(1, "Comic Sans MS", 12)
If OpenWindow(#Window_0, 216, 0, 350, 190, "Alarme", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
SetWindowColor(#Window_0, $110022)
If CreateGadgetList(WindowID(#Window_0))
TextGadget(#Text_0, 10, 50, 50, 30, "Heure :")
SetGadgetFont(#Text_0, FontID1)
SetGadgetColor(#Text_0, #PB_Gadget_FrontColor, RGB(255,255,255))
SetGadgetColor(#Text_0, #PB_Gadget_BackColor, $110022)
TextGadget(#Text_1, 10, 90, 70, 30, "Minute :")
SetGadgetFont(#Text_1, FontID1)
SetGadgetColor(#Text_1, #PB_Gadget_FrontColor, RGB(255,255,255))
SetGadgetColor(#Text_1, #PB_Gadget_BackColor, $110022)
TextGadget(#Text_2, 10, 130, 80, 30, "Seconde :")
SetGadgetFont(#Text_2, FontID1)
SetGadgetColor(#Text_2, #PB_Gadget_FrontColor, RGB(255,255,255))
SetGadgetColor(#Text_2, #PB_Gadget_BackColor, $110022)
TextGadget(#Text_3, 10, 10, 190, 30, "ouvrir le son de l'alarme :")
SetGadgetFont(#Text_3, FontID1)
SetGadgetColor(#Text_3, #PB_Gadget_FrontColor, RGB(255,255,255))
SetGadgetColor(#Text_3, #PB_Gadget_BackColor, $110022)
StringGadget(#String_0, 100, 50, 40, 20, heur$)
SetGadgetColor(#String_0, #PB_Gadget_FrontColor, RGB(0,0,255))
StringGadget(#String_1, 100, 130, 40, 20, minute$)
SetGadgetColor(#String_1, #PB_Gadget_FrontColor, RGB(0,0,255))
StringGadget(#String_2, 100, 90, 40, 20, seconde$)
SetGadgetColor(#String_2, #PB_Gadget_FrontColor, RGB(0,0,255))
ButtonGadget(#Button_0, 210, 10, 130, 20, "Ouvrir")
ButtonGadget(#Button_1, 10, 160, 130, 20, "Lancer")
DisableGadget(#Button_1, 1)
EndIf
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadget()
Case #Button_0
NomFichier$ = OpenFileRequester("ouvrir le son de l'alarme", "", "alarme|*.mp3;*.wav;*.wave", 0)
DisableGadget(#Button_0, 1)
DisableGadget(#Button_1, 0)
Case #Button_1
heureactuel$ = FormatDate("%hh:%ii:%ss", Date())
SetWindowState(#Window_0, #PB_Window_Minimize)
DisableGadget(#String_0, 1)
DisableGadget(#String_1, 1)
DisableGadget(#String_2, 1)
DisableGadget(#Button_1, 1)
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
voila @++