请教个问题,如何合并2个二进制数组
abuf:array [0..100] of byte;
bbuf:array [0..100] of byte;
cbuf:array [0..200] of byte;
就是得到cbuf=abuf+bbuf
用什么函数,谢谢各位了??
-----------------------
还有如何将string字符串转换成buf??用什么函数??

解决方案 »

  1.   


    cbuf:array.text +=copy(abuf:array.text,1,100)+copy(bbuf:array.text,1,100);
      

  2.   

    cbuf:array.text := copy(abuf:array.text,1,100)+copy(bbuf:array.text,1,100);
      

  3.   

    procedure Move(const Source; var Dest; Count: Integer);
      

  4.   

    procedure TForm1.Button1Click(Sender: TObject);
    var a:array[1..4] of byte;
        b:array[1..4] of byte;
        c:array[1..8] of byte;
        I:integer;
    begin
        for I:=1 to 4 do
        begin
            a[I]:=I;
            b[I]:=I;
        end;
        move(a[1],c[1],length(a));
        move(b[1],c[length(a)+1],length(b));
        for I:=1 to length(c) do
        begin
            showmessage(IntToStr(c[i]));
        end;
    end;
      

  5.   

    procedure TForm1.Button1Click(Sender: TObject);
    var a:array[1..4] of byte;
        b:array[1..4] of byte;
        c:array[1..8] of byte;
        I:integer;
    begin
        for I:=1 to 4 do
        begin
            a[I]:=I;
            b[I]:=I;
        end;
        move(a[1],c[1],length(a));
        move(b[1],c[length(a)+1],length(b));
        for I:=1 to length(c) do
        begin
            showmessage(IntToStr(c[i]));
        end;
    end;
      

  6.   

    不知道还能不能留言
    procedure TForm1.Button2Click(Sender: TObject);
    var temp:string;
        buff:array of Char;
    begin
        temp:='Hello I am Xiaohe!';
        setlength(buff,length(temp));
        move(temp[1],buff[0],length(temp));
        showmessage(string(buff));
    end;
      

  7.   

    Copymemory(@cbuf[0],@abuf[0],100);
    Copymemory(@cbuf[100],@Bbuf[0],100);
      

  8.   

    ▲▲▲▲还有如何将string字符串转换成buf??用什么函数??
      

  9.   

    buf是什么类型的?
    procedure TForm1.Button2Click(Sender: TObject);
    var temp:string;
        buff:array of Char;
    begin
        temp:='Hello I am Xiaohe!';
        setlength(buff,length(temp));
        move(temp[1],buff[0],length(temp));
        showmessage(string(buff));
    end;
    这个不行吗?!!!
      

  10.   

    cbuf:array.text := copy(abuf:array.text,1,100)+copy(bbuf:array.text,1,100);