Jump to content

Coversions


layer
 Share

Recommended Posts

hey guys... i was just doing some homework and were "reviewing" metric units and stuff.. so heres "Conversions"... it has inches to feet, feet to inches, ounces to pounds, and pounds to ounces... im NOT finished yet... i am still going to add more, and probably a calculator in the same gui..

#include <GUIConstants.au3>
GUICreate ("Conversions")
GUISetState (@SW_SHOW)
$b= GUICtrlCreateButton ("Convert", 5, 30)
$l= GUICtrlCreateLabel ("Feet to inches:", 1, 1)
$i= GUICtrlCreateInput ("Feet here", 55, 33)
$b2= GUICtrlCreateButton ("Convert", 5, 100,)
$l2= GUICtrlCreateLabel ("Inches to feet:", 1, 75) 
$i2= GUICtrlCreateInput ("Inches here", 54, 103)
$b3= GUICtrlCreateButton ("Convert", 5, 170)
$l3= GUICtrlCreateLabel ("Ounces to pounds:", 1, 145)
$i3= GUICtrlCreateInput ("Ounces here", 53, 173)
$b4= GUICtrlCreateButton ("Convert", 5, 233)
$l4= GUICtrlCreateLabel ("Pounds to ounces:", 1, 210)
$i4= GUICtrlCreateInput ("Pounds to ounces", 53, 235)
While 1
   $get= GUIGetMsg ()
   $tmpread2= GUIRead ($i2)
   $tmpread= GUIRead ($i)
   Select
   Case $get= $GUI_EVENT_CLOSE
      ExitLoop
   Case $get= $b
      $tmpread= GUIRead ($i)
      $fee2in= Number ($tmpread*12)
      MsgBox (0, "Result", $fee2in & " Inches")
   Case $get= $b2
      If $tmpread2= 12 Then
         MsgBox (0, "Result", "1 Foot")
      Else 
         $in2fee= Number ($tmpread2/12)
      MsgBox (0, "Result", $in2fee & " Feet")
   EndIf
Case $get= $b3
   $tmpread= GUIRead ($i3)
   If $tmpread= 16 Then
      MsgBox (0, "Result", "1 Pound")
      Else
   $tmpread= GUIRead ($i3)
   $oz2lb= Number ($tmpread/16)
   MsgBox (0, "Result", $oz2lb & " Pounds")
EndIf
Case $get= $b4
   $tmpread= GUIRead (14)
   $lb2oz= Number ($tmpread*16)
   MsgBox (0, "Result", $lb2oz & " Ounces")
   EndSelect
   WEnd

enjoy :idiot:

FootbaG
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...