如何将这段FoxPro代码转成Delphi6的呢?谢谢 ( 积分: 100 )

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

ysx_5

Unregistered / Unconfirmed
GUEST, unregistred user!
*DECRYPT********************
PARAMETER M
PRIVATE I , D , C , S , T
D = '12345678901234567890'
C = ''
S = ''
FOR I = 1 TO LEN(M)
C = C + SUBSTR(D,VAL(CHR(ASC(SUBSTR(M,I,1)) + 32)) + 1,1)
ENDFOR
FOR I = 1 TO LEN(RTRIM(C)) / 3
T = VAL(SUBSTR(C,(I - 1) * 3 + 1,3))
S = S + CHR(IIF(T > 255,0,T))
ENDFOR
RETURN S
************************************
我一直搞不通,谢谢大家。
 
function(m: string):string
var
i,d,c,s,t:string
begin
D := '12345678901234567890'
C := ''
S := ''
FOR I = 1 TO LEN(M) do
C = C + copy(D,ord(CHR(ord(copy(M,I,1)) + 32)) + 1,1)

FOR I = 1 TO LEN(TRIM(C)) / 3
begin
T = ord(copy(C,(I - 1) * 3 + 1,3))
if T>255 then
s:=s+chr(0)
else
S = S + CHR(T)
end
result:=s;
end
 
后退
顶部