我是delphi新手...我自定义的delphi方法,一运行就报错谁能告诉我正确的写法咯,加点注释最好了

解决方案 »

  1.   

    这问题问的, 你把报错的贴出来看看
    function func(Aparam; integer): integer;
    procedure proc(Aparam; integer);
      

  2.   

    unit Unit16;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TForm16 = class(TForm)
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
        procedure proc(const Value : string);
        function fun(const Value : string) : string;
      public
        { Public declarations }
    //    procedure proc(const Value : string);         //上边的两个过程放在这里就是公有的
    //    function fun(const Value : string) : string;
      end;var
      Form16: TForm16;implementation{$R *.dfm}procedure TForm16.FormCreate(Sender: TObject);
    var
      s : string;
    begin
      s := fun('abc');
      proc(s);
    end;function TForm16.fun(const Value: string): string;
    begin
      Result := Value + 'aa';
    end;procedure TForm16.proc(const Value: string);
    begin
      ShowMessage(Value);
    end;end.
      

  3.   

    我觉得自已方法完全可以模仿 控件的事件来写啊。
    主要用好几个快捷键Ctrl+Shift+C/↑/↓  
    C:写完函数声明后,自动写出实现部分
    ↑/↓ :在函数声明和实现部分切换