Thema: Delphi From VB to Delphi

Einzelnen Beitrag anzeigen

mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

From VB to Delphi

  Alt 4. Apr 2007, 09:11
I want to Translate this VB Code into Delphi :
Code:
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
many thanks
  Mit Zitat antworten Zitat