DELPHI定义过程是什么意思,过程有什么用。他没有返回值是什么意思?

解决方案 »

  1.   

    ShowMessage  是DELPHI的一個過程吧。呵呵,他沒有任何返回值,就是做個信息提示
      

  2.   

    procedure翻成过程,function翻成函数,其实不算有差别
      

  3.   


    procedure test()
    begin
    end;void test()
    {
    }
      

  4.   

    函数的实现
      Function GetMax(i,j:Integer):Integer;
      begin
       if i>j then
       begin
         result:=i;
       end else
       begin
         result:=j;
       end;  end;
    函数的使用
      k1:=1;
      k2:=3;
      max=GetMax(k1,k1);//结果由返回值获得过程的实现
      Procedure GetMax(i,j:Integer;var max:Integer);//参数前加var,表示地址引用
      begin
       if i>j then
       begin
         max:=i;
       end else
       begin
         max:=j;
       end;  end;
    过程的使用
      k1:=1;
      k2:=3;
      GetMax(k1,k1,max);//过程无返回值,若需返回内容可通过地址引用的参数var max返回