home *** CD-ROM | disk | FTP | other *** search
/ Freelog 10 / Freelog010.iso / Prog / Algo / convertisseurCF.frm < prev    next >
Text File  |  2000-04-20  |  5KB  |  184 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Convertisseur Celsius/Farenheit"
  4.    ClientHeight    =   5310
  5.    ClientLeft      =   165
  6.    ClientTop       =   735
  7.    ClientWidth     =   7800
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5310
  10.    ScaleWidth      =   7800
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.TextBox fin 
  13.       Height          =   495
  14.       Left            =   1080
  15.       TabIndex        =   4
  16.       Top             =   4080
  17.       Width           =   1215
  18.    End
  19.    Begin VB.TextBox debut 
  20.       Height          =   495
  21.       Left            =   1080
  22.       TabIndex        =   3
  23.       Top             =   3480
  24.       Width           =   1215
  25.    End
  26.    Begin VB.TextBox resultat 
  27.       Height          =   4935
  28.       Left            =   5040
  29.       MultiLine       =   -1  'True
  30.       TabIndex        =   2
  31.       Top             =   240
  32.       Width           =   2655
  33.    End
  34.    Begin VB.TextBox ecart 
  35.       Height          =   495
  36.       Left            =   1080
  37.       TabIndex        =   1
  38.       Top             =   1080
  39.       Width           =   1215
  40.    End
  41.    Begin VB.CommandButton cmdvalid 
  42.       Caption         =   "Valider"
  43.       Height          =   495
  44.       Left            =   1080
  45.       TabIndex        =   0
  46.       Top             =   4680
  47.       Width           =   1215
  48.    End
  49.    Begin VB.Label Label7 
  50.       Caption         =   "Indiquez les limites de vos conversions"
  51.       Height          =   735
  52.       Left            =   1080
  53.       TabIndex        =   11
  54.       Top             =   2640
  55.       Width           =   1215
  56.    End
  57.    Begin VB.Label Label6 
  58.       Caption         =   "maximum"
  59.       Height          =   495
  60.       Left            =   360
  61.       TabIndex        =   10
  62.       Top             =   4080
  63.       Width           =   1215
  64.    End
  65.    Begin VB.Label Label5 
  66.       Caption         =   "minimum"
  67.       Height          =   495
  68.       Left            =   360
  69.       TabIndex        =   9
  70.       Top             =   3480
  71.       Width           =   1215
  72.    End
  73.    Begin VB.Label Label3 
  74.       Caption         =   "a=1░ b=2░ c=3░ d=4░ e=5░"
  75.       Height          =   1455
  76.       Left            =   2400
  77.       TabIndex        =   8
  78.       Top             =   840
  79.       Width           =   375
  80.    End
  81.    Begin VB.Label Label2 
  82.       Caption         =   "Choisissez un ecart pour vos temperatures  : "
  83.       Height          =   1215
  84.       Left            =   1080
  85.       TabIndex        =   7
  86.       Top             =   360
  87.       Width           =   1215
  88.    End
  89.    Begin VB.Label Label1 
  90.       Caption         =   "Farenheit"
  91.       Height          =   255
  92.       Index           =   1
  93.       Left            =   6000
  94.       TabIndex        =   6
  95.       Top             =   0
  96.       Width           =   855
  97.    End
  98.    Begin VB.Label Label1 
  99.       Caption         =   "Celcius"
  100.       Height          =   255
  101.       Index           =   0
  102.       Left            =   5040
  103.       TabIndex        =   5
  104.       Top             =   0
  105.       Width           =   615
  106.    End
  107.    Begin VB.Menu mnquit 
  108.       Caption         =   "Quitter"
  109.       Index           =   1
  110.    End
  111.    Begin VB.Menu mnαpropos 
  112.       Caption         =   "?"
  113.    End
  114. End
  115. Attribute VB_Name = "Form1"
  116. Attribute VB_GlobalNameSpace = False
  117. Attribute VB_Creatable = False
  118. Attribute VB_PredeclaredId = True
  119. Attribute VB_Exposed = False
  120.  
  121. Private Sub Cmdvalid_Click()
  122.  
  123. 'definition de l'Θcart de tempΦrature
  124.  
  125. If ecart.Text = "a" Then
  126.      pas = 1
  127.   End If
  128.   If ecart.Text = "b" Then
  129.      pas = 2
  130.   End If
  131.   If ecart.Text = "c" Then
  132.      pas = 3
  133.   End If
  134.   If ecart.Text = "d" Then
  135.      pas = 4
  136.   End If
  137.   If ecart.Text = "e" Then
  138.      pas = 5
  139.   End If
  140.   
  141.   If pas = "" Then
  142.   r = MsgBox("Vous devez saisir une lettre entre a et e")
  143.   Else
  144.  
  145.   D = debut.Text
  146.   F = fin.Text
  147.   rc = Chr(13) + Chr(10)
  148.   
  149.   
  150.   'controle de la saisie des limites des tempΦratures
  151.   
  152. If debut.Text = "" Or fin.Text = "" Or fin.Text < debut.Text Then
  153.   r = MsgBox("Bornes numΘrique obligatoires")
  154. Else
  155.  
  156.   'contr⌠le du nombre de rΘsultats α afficher
  157.   
  158.   T = fin.Text - debut.Text
  159.   I = T / pas
  160.   If I > 20 Then
  161.     r = MsgBox("modifiez vos donnΘes : Le nombre de rΘsultats est > α 20")
  162.   Else
  163.  
  164.   'calcul de la conversion Celsius->Farenheit
  165.    For C = D To F Step pas
  166.      
  167.      resultat.Text = resultat.Text + rc + Str(C) + "                   " + Str(((C * 9 / 5) + 32))
  168.   
  169.    Next
  170.   End If
  171.   End If
  172.   End If
  173. End Sub
  174.  
  175.  
  176.  
  177. Private Sub mnαpropos_Click()
  178.   r = MsgBox("E-Mail : PierrotRN@aol.com")
  179. End Sub
  180.  
  181. Private Sub mnquit_Click(Index As Integer)
  182.   End
  183. End Sub
  184.