怎样等到一个字符的ASCII码

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      showmessage(inttostr(ord('A')));
    end;
      

  2.   

    ord()
    uses Dialogs;
    type   Colors = (RED,BLUE,GREEN);var  S: string;
     begin
       S := 'BLUE has an ordinal value of ' + IntToStr(Ord(BLUE)) + #10;
       S := S + 'The ASCII code for "c" is ' + IntToStr(Ord('c')) +  ' decimal';
       MessageDlg(S, mtInformation, [mbOk], 0, mbOK);
     end;
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      showmessage(inttostr(ord('A')));
    end;