把VB语句转成delphi语句!(50分)

  • 主题发起人 主题发起人 yujiu2000
  • 开始时间 开始时间
Y

yujiu2000

Unregistered / Unconfirmed
GUEST, unregistred user!
把下列的VB语名转成delphi语句:
//----------------------------------
Public Function Compare(Addres As String) As String '校验位处理函数
Dim lenth As String
Dim X As Long
Dim a(2) As String
lenth = Len(Addres)
For i = 1 To lenth
X = X + Asc(Mid(Addres, i, 1))
Next i
X = X Mod 256
a(1) = LTrim(Str(X / 16))
a(2) = LTrim(Str(X Mod 16))
For i = 1 To 2
If Val(a(i)) >= 0 And Val(a(i)) <= 9 Then
a(i) = a(i)
ElseIf Val(a(i)) > 9 And Val(a(i)) <= 15 Then
a(i) = Chr(55 + Val(a(i)))
End If
Next
Compare = a(1) + a(2)
End Function
//-------------------------------------------
Public Function Shex(instring As String) As String '将字符转换成四个十六进制字符的函数
Dim X As Long
X = Val(instring)
Shex = Hex(X)
If Len(Shex) < 4 Then
For i = 1 To 4 - Len(Shex)
Shex = "0" + Shex
Next
End If
End Function
//------------------------------
Public Function WAITING(WAITTIME As Integer) As String '延时处理函数
On Error Resume Next
Dim EndTime As Long
EndTime = Timer + WAITTIME
Do
DoEvents
If Timer >= EndTime Then
Exit Do
End If
Loop Until mpoffice.Comm1.InBufferCount >= 2
WAITING = mpoffice.Comm1.Input
WAITING = ZhaoSheng(WAITING)
End Function
//--------------------------
 
于玖
先“找”我之前的100分!!!!!!!!!!!!!!!!!!!!!!!!!!

最多打个折头, 先比50分 [8D]
 
接受答案了.
 
后退
顶部