把参数写在ini
文件里,
在窗体的create
事件里读取参数

解决方案 »

  1.   

    用paramcount和parastr这两个函数
    例:procedure TForm1.FormCreate(Sender: TObject);var
      i: Integer;
      for i := 1 to ParamCount do
      begin
        if LowerCase(ParamStr(i)) = 'beep' then
          Beep
        elseif LowerCase(ParamStr(i)) = 'exit' then
          Application.Terminate;
      end;
    end;
      

  2.   

    用paramcount和parastr这两个函数
    例:procedure TForm1.FormCreate(Sender: TObject);var
      i: Integer;
      for i := 1 to ParamCount do
      begin
        if LowerCase(ParamStr(i)) = 'beep' then
          Beep
        elseif LowerCase(ParamStr(i)) = 'exit' then
          Application.Terminate;
      end;
    end;
      

  3.   

    用paramcount和parastr这两个函数
    例:procedure TForm1.FormCreate(Sender: TObject);var
      i: Integer;
      for i := 1 to ParamCount do
      begin
        if LowerCase(ParamStr(i)) = 'beep' then
          Beep
        elseif LowerCase(ParamStr(i)) = 'exit' then
          Application.Terminate;
      end;
    end;
      

  4.   

    同意jmj83的,如果是參數,相信可以說是沒有限制
      

  5.   

    启动参数可以放在INI文件或注册表中,如何读取和写入可参阅相关书籍,一般的Delphi入门书籍上都有。
      

  6.   

    sNowPath:=ExtractFilePath(Application.ExeName);//get the run path
       fSetting:=TIniFile.Create(sNowPath+'setting.ini');
       with Fsetting do //read from setting.ini
       begin
        mobiles:=readstring('type','mobiles','');
        gPrintType:=readInteger('run','printtype',1);//1为串口方式打印,2为并口方式打印
        gMobilePortNo:=readInteger('run','mobilePortNo',1);//
        gPrintPortNo:=readInteger('run','PrintPortNO',2);
        gMobileIndex:=readinteger('type','nowtype',1);//当前手机索引号
        gDataType:=readbool('run','datatype',true);//缺省为服务器提交方式
       end;
       fSetting.Free();
    //老兄,可以了吗?
      

  7.   

    还有,如果是string类型的话,长度好象没有限制,至少没有255个byte的限制,至于integer,好象不能表示正负