var S:String; P:PChar; B:array of Byte;begin S:='Hello'; SetLength(B,Length(S)+1); P:=PChar(S); CopyMemory(B,P,Length(S)+1); ShowMessage(Char(B[0]));end; Length(S)+1 可以拷贝字符串最后的 #0 var str:string; B:array of byte; begin str:='string'; setlengt
字串转字节数组 一.CopyMemory var s:PAnsiChar; ary:TArray<Byte>; bt:Byte; begin s:='Form Delphi'; SetLength(ary,Length(); CopyMemory(ary,s,Length(s)); mmo1.Clear; for bt in ary do begin mmo1.Lines.Append(Chr(bt)); end; end; 二.Move var s:PAnsiChar; pb:PByte;
TStream实现多表提交 function TynFiredac.SaveDatas(const ATableName, ATableName2: string; ADeltas: TStream; AStorageFormat: string = 'binary'): string; var LStream1, LStream2: TStream; begin Result := 'false'; if (ATableName = '') or (ADeltas = nil) or (ATa