Le souci est que je n'obtiens pas les resultats voulus.
Pour la formule, je l'ai prise sur ce site : http://easycompte.free.fr/Scripts/Emprunt_com.php
Voilà mon code qui me pose probléme :
Code : Tout sélectionner
Enumeration
#Window_0
EndEnumeration
Enumeration
#Text_0
#Text_1
#Text_2
#String_0
#String_1
#String_2
#Text_3
#Text_4
#Frame3D_0
#Frame3D_1
#String_4
#String_5
#Text_6
EndEnumeration
Global FontID1
FontID1 = LoadFont(1, "Arial", 26, #PB_Font_Bold)
Procedure Open_Window_0()
If OpenWindow(#Window_0, 216, 0, 430, 280, "Logibanque", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
TextGadget(#Text_0, -10, 85, 200, 20, "Somme empruntée", #PB_Text_Right)
TextGadget(#Text_1, -10, 115, 200, 20, "Taux d'interet (en %)", #PB_Text_Right)
TextGadget(#Text_2, -10, 145, 200, 20, "Durée de l'emprunt (en années)", #PB_Text_Right)
StringGadget(#String_0, 200, 80, 200, 20, "0")
StringGadget(#String_1, 200, 110, 200, 20, "0")
StringGadget(#String_2, 200, 140, 200, 20, "0")
TextGadget(#Text_3, -10, 205, 200, 20, "Remboursement mensuel", #PB_Text_Right)
TextGadget(#Text_4, -10, 235, 200, 20, "Coût de l'emprunt", #PB_Text_Right)
Frame3DGadget(#Frame3D_0, 20, 65, 390, 110, "Paramétres d'emprunt")
Frame3DGadget(#Frame3D_1, 20, 185, 390, 80, "Valeurs calculées")
StringGadget(#String_4, 200, 200, 200, 20, "0", #PB_String_ReadOnly)
StringGadget(#String_5, 200, 230, 200, 20, "0", #PB_String_ReadOnly)
TextGadget(#Text_6, 80, 10, 250, 50, "Logibanque", #PB_Text_Center)
SetGadgetFont(#Text_6, FontID1)
EndIf
EndIf
EndProcedure
Procedure calcul(montant.f,taux.f,duree.f)
mensualite.f = montant.f * ((taux.f / 100 / 12) / (1 - Pow(1 + (taux.f / 100),-duree.f * 12)))
cout.f = duree.f * mensualite.f
SetGadgetText(#String_4,StrF(mensualite.f,2))
SetGadgetText(#String_5,StrF(cout.f,2))
EndProcedure
Open_Window_0()
Repeat
evenement = WaitWindowEvent()
Select EventWindow()
;=====================================================
;== EVENEMENTS DE LA FENETRE PRINCIPALE
;=====================================================
Case #Window_0
Select evenement
Case #PB_Event_Gadget
If EventGadget() = #String_0 Or EventGadget() = #String_1 Or EventGadget() = #String_2
If GetGadgetText(#String_0) <> "0" And GetGadgetText(#String_1) <> "0" And GetGadgetText(#String_2) <> "0"
calcul(ValF(GetGadgetText(#String_0)), ValF(GetGadgetText(#String_1)), ValF(GetGadgetText(#String_2)))
EndIf
EndIf
Case #PB_Event_CloseWindow
End
EndSelect
EndSelect
ForEver





Merci beaucoup à celui ou celle qui m'expliquera pourquoi ca ne fonctionne pas


