Jump to content
Sign in to follow this  
FireLord

Temp Converter

Recommended Posts

FireLord

If you find any bugs, feel free to fix them.

;####################
; Written by FireLord
;####################
; If you find any mistakes, feel free to fix them.

#include <GUIConstants.au3>
GUICreate("Temp Conversion", 350, 140)
GUISetState()
$flabel = GUICtrlCreateLabeL("Enter Fahrenheit", 15, 18, 80)    
GUICtrlSetColor(-1,0xff0000)  ; Red
$ftemp = GUICtrlCreateInput("", 15, 40, 50, 20); Enters Fahrenheit
$fbutton = GUICtrlCreateButton("Calculate", 105, 13); Calculates temperature
$clabel = GUICtrlCreateLabeL("Enter Celsius", 180, 18, 80)  
GUICtrlSetColor(-1,0x0000ff)  ; Blue
$ctemp = GUICtrlCreateInput("", 180, 40, 50, 20); Enters Celsius
$cbutton = GUICtrlCreateButton("Calculate", 270, 13); Calculates temperature

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_Event_Close
            Exit 0
        Case $msg = $fbutton
            $celsius = (GUICtrlRead($ftemp) - 32)/1.8
            GUICtrlCreateLabel($celsius & " degrees celsius equals " & GUICtrlRead($ftemp) & " fahrenheit", 15, 60, 70, 150)
        Case $msg = $cbutton
            $fahrenheit = (GUICtrlRead($ctemp) * (212 -32)/100 + 32)
            GUICtrlCreateLabel($fahrenheit & " degrees fahrenheit equals " & GUICtrlRead($ctemp) & " celsius", 180, 60, 70, 150)
    EndSelect
WEnd

ConvTemp.au3

Edited by FireLord

[center]See the Helpfile[/center]
While Alive()
	 DrinkWine();
}
[center][/center]

Share this post


Link to post
Share on other sites
Nahuel

Cool :P You could add Kelvins too.

Share this post


Link to post
Share on other sites
FireLord

Cool :P You could add Kelvins too.

Good idea. ;)


[center]See the Helpfile[/center]
While Alive()
	 DrinkWine();
}
[center][/center]

Share this post


Link to post
Share on other sites
FireLord

Ok, changed this one up a bit, supports Kelvin now :P and doesn't have multiple inputs anymore.

If you find any bugs, feel free to fix them.

ConvTemp.au3


[center]See the Helpfile[/center]
While Alive()
	 DrinkWine();
}
[center][/center]

Share this post


Link to post
Share on other sites
DirtDBaK

I once made something like this for the TI-84.... nice work though!


[center][/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×