求打印 ASCII码的代码

解决方案 »

  1.   

    怎么打印,打印到哪,dos窗口还是打印机,  Ord('A')
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Memo1: TMemo;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
      i: Integer;
      str: string;
    begin
      memo1.Lines.Clear;
      str := '';
      for i := 1 to 255 do
      begin
        str :=  str + format(' %.2x : %s  ',[i,chr(i)]);
        if (i mod 8) = 0 then
        begin
          memo1.Lines.Append(str);
          str := '';
        end;
      end;
    end;end.
      

  3.   

    用的什么版本的delphi,先转了asii字符吗?
      

  4.   


    // 创建一个空白窗体,然后添加一个 Memo(Memo1) 和一个 Button(Button1) ,双击 Button1,用下面的代码即可。function GetAscii(FromNum, ToNum: Integer): string;
    var
      I: Integer;
    begin
      for I := FromNum to ToNum do begin
        Result := Result + IntToStr(I) + #9 + Chr(I) + #13#10;
      end;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      Memo1.Clear;
      Memo1.Lines.Text := GetAscii(32, 126);
    end;
      

  5.   

    添加fastreport3.0控件,报表比较好做呢!