如题

解决方案 »

  1.   

    var p:PCharp:=PChar(str);
    While p^<>$0 do
      p^:=p^+3;
      

  2.   

    楼上的好像不行阿!
    用什么uses阿!?
      

  3.   

    for I:= 0 to length(str) - 1 do
    begin
      str[I] := char(ord(str[I])+3);
    end;
      

  4.   

    procedure TForm1.Button1Click(Sender: TObject);
    var I: integer;
       str: string;
    begin
       str := 'ABC';
       for I:= 0 to length(str) - 1 do
       begin
           str[I] := char(ord(str[I])+3);
       end;
       showmessage(str);
    end;
      

  5.   

    var
      S: string;
      I, N: Integer;
    begin
      S := '1234';
      N := 3;  // 要增加的数值
      for I := 1 to Length(S) do
        S[I] := Chr(Ord(S[I]) + N);  // char进行+3
      Caption := S;
    end;
      

  6.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
        procedure AddChar(var AStr: string);
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.AddChar(var AStr: string);
    var
      i: Integer;
    begin
      for i := 1 to Length(AStr) do
        AStr[i] := Char((Ord(AStr[i]) + 3));
    end;procedure TForm1.Button1Click(Sender: TObject);
    var
      vStr: string;
    begin
      vStr := 'ABC';
      AddChar(vStr);
      ShowMessage(vStr);   // DEF;
    end;end.
      

  7.   

    对qiume(杜克),jacky_shen(jacky)兄的严谨的治学态度表示敬佩!在此表示感谢