Salut , je veux bien traduire ce Code en VB to Delphi :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
Private Sub cmdTP_Click()
MyStrg = ""
MSComm1.Output = "0111" & vbCr
MyStrg = MSComm1.Input
    Text1.Text = MyStrg
    Temp = Mid(MyStrg, 12, 3)
    If InStr(1, Temp, ">") <> 0 Then
    'If Mid(MyStrg, 12, 1) = ">" Then
    B1 = Mid(MyStrg, 7, 2)
'Convert slection into decimal
B2 = ("&H" & B1)
'calulate it
TP = (B2 / 256) * 100
TP = Format(TP, "0")
'output
lblTP.Caption = TP & " %"
Else
'Do Nothing
End If
End Sub
Merçi