FireFox Posted April 19, 2013 Share Posted April 19, 2013 Local $iKg = 65 Local $iHeight = 185 / 10 ;cm Local $iBMI = $iKg / ($iHeight ^ 2) ConsoleWrite("BMI: " & Round($iBMI, 2) & @CrLf) Link to comment Share on other sites More sharing options...
future1995man Posted April 19, 2013 Author Share Posted April 19, 2013 (edited) Local $iKg = 65 Local $iHeight = 185 / 10 ;cm Local $iBMI = $iKg / ($iHeight ^ 2) ConsoleWrite("BMI: " & Round($iBMI, 2) & @CrLf) Please can you give me full script to read every line I am beginer Edited April 19, 2013 by future1995man Link to comment Share on other sites More sharing options...
future1995man Posted April 19, 2013 Author Share Posted April 19, 2013 (edited) Please can you give me full script to read every linesame czardas's post(#8)It clear every thing in scriptI am beginer Edited April 19, 2013 by future1995man Link to comment Share on other sites More sharing options...
future1995man Posted April 19, 2013 Author Share Posted April 19, 2013 please help me, this first time I post topic in this forum Link to comment Share on other sites More sharing options...
FireFox Posted April 19, 2013 Share Posted April 19, 2013 There's nothing to explain, it's just maths. Concerning the functions, use the help file Br, FireFox. Link to comment Share on other sites More sharing options...
future1995man Posted April 20, 2013 Author Share Posted April 20, 2013 There's nothing to explain, it's just maths. Concerning the functions, use the help file Br, FireFox.can you make same next calculatorhttp://lowcarbdiets.about.com/library/blbmicalculator.htmplease can you see attached file. Link to comment Share on other sites More sharing options...
FireFox Posted April 20, 2013 Share Posted April 20, 2013 Take a look at the GUICtrlCreate* functions, GUIGetMsg/GUICtrlSetOnEvent. Br, FireFox. Link to comment Share on other sites More sharing options...
FireFox Posted April 20, 2013 Share Posted April 20, 2013 expandcollapse popup#include <GUIConstantsEx.au3> #include <EditConstants.au3> #region GUI Local $hGUI = 0, $iRadioCmKg = 0, $iInputHeight = 0, $iInputWeight = 0, $iButtonCalc = 0, $iInputBMI = 0 $hGUI = GUICreate("MyGUI") GUICtrlCreateLabel("Body Mass Index", 10, 10) $iRadioCmKg = GUICtrlCreateRadio("cm/kg", 10, 30) GUICtrlSetState($iRadioCmKg, $GUI_CHECKED) GUICtrlCreateRadio("in/lb", 80, 30) GUICtrlCreateLabel("Height:", 10, 60) $iInputHeight = GUICtrlCreateInput("", 50, 57, 80, 20, $ES_AUTOHSCROLL) GUICtrlCreateLabel("Weight:", 10, 90) $iInputWeight = GUICtrlCreateInput("", 50, 87, 80, 20, $ES_AUTOHSCROLL) $iButtonCalc = GUICtrlCreateButton("Calculate", 30, 115, 80, 22) GUICtrlCreateLabel("BMI:", 10, 150) $iInputBMI = GUICtrlCreateInput("", 50, 147, 80, 20, $ES_AUTOHSCROLL) GUISetState(@SW_SHOW, $hGUI) #endregion Local $iWeight = 0, $iHeight = 0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iButtonCalc $iWeight = Number(GUICtrlRead($iInputWeight)) $iHeight = Number(GUICtrlRead($iInputHeight)) If GUICtrlRead($iRadioCmKg) = $GUI_CHECKED Then $iRes = $iWeight / (($iHeight / 100) ^ 2) Else $iRes = ($iWeight / ($iHeight ^ 2)) * 703.06957964 EndIf GUICtrlSetData($iInputBMI, Round($iRes, 2)) EndSwitch Sleep(10) WEnd GUIDelete($hGUI) Before asking any question, please read the helpfile. Link to comment Share on other sites More sharing options...
forever0donotknowme Posted April 21, 2013 Share Posted April 21, 2013 thanks my sir..... really you are expert. Melba please close this topic Link to comment Share on other sites More sharing options...
forever0donotknowme Posted April 22, 2013 Share Posted April 22, 2013 (edited) Case $iButtonCalc $iWeight = Number(GUICtrlRead($iInputWeight)) $iHeight = Number(GUICtrlRead($iInputHeight)) If GUICtrlRead($iRadioCmKg) = $GUI_CHECKED Then $iRes = $iWeight / (($iHeight / 100) ^ 2) Else $iRes = ($iWeight / ($iHeight ^ 2)) * 703.06957964 EndIf $iRes=GUICtrlSetData($iInputBMI, Round($iRes, 2)) IF GUICtrlRead($iRes) <=18.5 Then MsgBox(0,"BMI","Underweight") ElseIf GUICtrlRead($iRes) >=18.5 and GUICtrlRead($iRes) <=24.9 Then MsgBox(0,"BMI","Healthy Weight") ElseIf GUICtrlRead($iRes) <=25 GUICtrlRead($iRes) <=29.9 Then MsgBox(0,"BMI","Overweight") ElseIf GUICtrlRead($iRes) >=30 Then MsgBox(0,"BMI","Obese") EndIf Edited April 22, 2013 by forever0donotknowme Link to comment Share on other sites More sharing options...
future1995man Posted April 22, 2013 Author Share Posted April 22, 2013 Case $iButtonCalc $iWeight = Number(GUICtrlRead($iInputWeight)) $iHeight = Number(GUICtrlRead($iInputHeight)) If GUICtrlRead($iRadioCmKg) = $GUI_CHECKED Then $iRes = $iWeight / (($iHeight / 100) ^ 2) Else $iRes = ($iWeight / ($iHeight ^ 2)) * 703.06957964 EndIf $iRes=GUICtrlSetData($iInputBMI, Round($iRes, 2)) IF GUICtrlRead($iRes) <=18.5 Then MsgBox(0,"BMI","Underweight") ElseIf GUICtrlRead($iRes) >=18.5 and GUICtrlRead($iRes) <=24.9 Then MsgBox(0,"BMI","Healthy Weight") ElseIf GUICtrlRead($iRes) <=25 GUICtrlRead($iRes) <=29.9 Then MsgBox(0,"BMI","Overweight") ElseIf GUICtrlRead($iRes) >=30 Then MsgBox(0,"BMI","Obese") EndIf What is advantage form this post. Link to comment Share on other sites More sharing options...
future1995man Posted April 22, 2013 Author Share Posted April 22, 2013 (edited) expandcollapse popup#include <GUIConstantsEx.au3> #include <EditConstants.au3> #region GUI Local $hGUI = 0, $iRadioCmKg = 0, $iInputHeight = 0, $iInputWeight = 0, $iButtonCalc = 0, $iInputBMI = 0 $hGUI = GUICreate("MyGUI") GUICtrlCreateLabel("Body Mass Index", 10, 10) $iRadioCmKg = GUICtrlCreateRadio("cm/kg", 10, 30) GUICtrlSetState($iRadioCmKg, $GUI_CHECKED) GUICtrlCreateRadio("in/lb", 80, 30) GUICtrlCreateLabel("Height:", 10, 60) $iInputHeight = GUICtrlCreateInput("", 50, 57, 80, 20, $ES_AUTOHSCROLL) GUICtrlCreateLabel("Weight:", 10, 90) $iInputWeight = GUICtrlCreateInput("", 50, 87, 80, 20, $ES_AUTOHSCROLL) $iButtonCalc = GUICtrlCreateButton("Calculate", 30, 115, 80, 22) GUICtrlCreateLabel("BMI:", 10, 150) $iInputBMI = GUICtrlCreateInput("", 50, 147, 80, 20, $ES_AUTOHSCROLL) GUISetState(@SW_SHOW, $hGUI) #endregion Local $iWeight = 0, $iHeight = 0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iButtonCalc $iWeight = Number(GUICtrlRead($iInputWeight)) $iHeight = Number(GUICtrlRead($iInputHeight)) If GUICtrlRead($iRadioCmKg) = $GUI_CHECKED Then $iRes = $iWeight / (($iHeight / 100) ^ 2) Else $iRes = ($iWeight / ($iHeight ^ 2)) * 703.06957964 EndIf GUICtrlSetData($iInputBMI, Round($iRes, 2)) EndSwitch Sleep(10) WEnd GUIDelete($hGUI) Before asking any question, please read the helpfile. excellent work.. I will read help file. Thank you very much. Edited April 22, 2013 by future1995man Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now