Original
Code:
'Convert the string from hex pairs to bytes and store in the machine code buffer
i = 1
Do While j < CODE_LEN
j = j + 1
sc_aBuf(j) = CByte("&H" & Mid$(sSubCode, i, 2)) 'Convert a pair of hex characters to an eight-bit value and store in the static code buffer array
i = i + 2
Loop 'Next pair of hex characters
Übersetzt.
Delphi-Quellcode:
//Convert the string from hex pairs to bytes and store in the machine code buffer
i := 1;
While j < CODE_LEN Do
inc(j);
sc_aBuf[j] := byte(MidStr('$' + sSubCode, i, 2)); //Convert a pair of hex characters to an
//eight-bit value and store in the static code buffer array
i := i + 2;
Delphi-Quellcode:
function MidStr(Const Str: String; From, Size: Word): String;
begin
MidStr := Copy(Str, From, Size)
end;
Fehler!
Zitat:
[Pascal Error] Magnetic.pas(850): E2089 Invalid typecast
Wie kann ich den String MidStr('$' + sSubCode, i, 2); nach byte convertieren ?
gruß