Covert to delphi...

Can you convert that source of Visual Basic to Delphi please.

Function Decode(Text)
For x = 1 To Len(Text) Step 2
thebyte = Chr(38) & "H" & Mid(Text, x, 2)
temptext = temptext & Chr(thebyte)
document.writeln(thebyte)
document.writeln(temptext)
Next
Decode = temptext
End Function


Thank you for your help

Comments

  • I've never used VB but I think Delphi(Pascal) translation could be:

    [CODE][SIZE=2][B]function[/B] Decode(Text [B]string[/B]): [B]string[/B];
    [B]var[/B]
    X: Integer;
    TheByte: [B]string[/B];
    TempText: [B]string[/B];
    [B]begin[/B]
    X := 1;
    [B]repeat[/B]
    TheByte := Char(38) + 'H' + Copy(Text,X,2);
    TempText := TempText + TheByte;
    Document.WriteLn(TheByte);
    Document.WriteLn(TempText);
    Inc(X,2);
    [B]until[/B] X >= Length(Text);
    Result := TempText;
    [B]end[/B];[/SIZE][/CODE]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion