DELPHI7适用的BytesOf和StringOf
DELPHI7适用的BytesOf和StringOf
function BytesOf(const Val: AnsiString): TBytes; var Len: Integer; begin Len := Length(Val); SetLength(Result, Len); Move(Val[1], Result[0], Len); end; function StringOf(const buf:TBytes): AnsiString; begin SetLength(Result, Length(buf)); CopyMemory(PAnsiChar(result), @buf[0], Length(buf)); end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/14210793.html