function GetProcessorType: string;
var OEMString: array[1..16] of char;
begin
     .
     .
     .
得到的结果放在OEMString中现在要把OEMString中的值赋予RESLUT
怎么做?
end;

解决方案 »

  1.   

    数组下标改为从0开始 然后 result:=OEMString;
      

  2.   

    procedure TForm1.Button2Click(Sender: TObject);
    var
      I : integer;
      aa : array[1..10] of char;
      bb : string;
    begin
      bb := '00123456789';
      for I:= 1 to 10 do
        aa[I] := 'a';
      bb := aa;
      showmessage(bb);
    end;
      

  3.   

    function GetProcessorType: string;
    var OEMString: array[0..11] of char;
    begin
      asm
       mov eax,0
       cpuid
       mov DWORD PTR OEMString,ebx
       mov DWORD PTR OEMString+4,edx
       mov DWORD PTR OEMString+8,ecx
      end;
      Result:=OEMString;
    end;
    你编绎一下试试好吗
      

  4.   

    function GetProcessorType: string;
    var OEMString: array[0..11] of char;
      i: SHORT;
      TmpStr: string;
    begin
      asm
       mov eax,0
       cpuid
       mov DWORD PTR OEMString,ebx
       mov DWORD PTR OEMString+4,edx
       mov DWORD PTR OEMString+8,ecx
      end;
      TmpStr:=OEMString;
      Result:=TmpStr;
    end;

      TmpStr:=OEMString;
    还是正确的但
      Result:=TmpStr;
    就不行了请问大侠是怎么回事
      

  5.   

    数组从0开始赋值到15,再Result:=OEMString就可以了
      

  6.   

    function GetProcessorType: string;
    var
      OEMString: array[1..16] of char;
      I: Integer;
    begin
      for I := 1 to 16 do
        OEMString[I] := 'A';
      SetLength(Result, Length(OEMString));
      CopyMemory(@Result[1], @OEMString[1], Length(OEMString));
    end;
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      Caption := GetProcessorType;
    end;