全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:735
推到 Plurk!
推到 Facebook!

無Form之程式

尚未結案
shing.net
中階會員


發表:207
回覆:124
積分:66
註冊:2002-03-16

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-11-13 18:04:36 IP:140.122.xxx.xxx 未訂閱
請問如和寫一程式其無form但可利用其參數執行有form之副程式 例如 win.exe A,B 其win.exe之程式如何取出參數A,B做後續處理 謝謝
pgdennis
資深會員


發表:41
回覆:526
積分:443
註冊:2002-05-23

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-11-13 21:34:04 IP:203.70.xxx.xxx 未訂閱
用ParamStr()    Returns a specified parameter from the command-line.  
The following example beeps once for each bbeeppassed in on 
the command line. The example terminates the application if  eexit
is passed in on the command line.    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; 
永遠追不上技術更新的速度 發表人 - pgdennis 於 2003/11/13 21:39:01
------
星期一,二...無窮迴圈@@
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-11-14 17:04:29 IP:202.39.xxx.xxx 未訂閱
1.無 Form 的程式: New 一個 Console Application 2.處理 Param 的方式如 pgdennis 兄所言    範例如下:
program Project1;
{$APPTYPE CONSOLE}
uses
  SysUtils;    var i: integer;    begin
  for i := 1 to ParamCount do
    WriteLn('Param'   IntToStr(i)   ': '   ParamStr(i));
end.
--- Everything I say is a lie.
系統時間:2024-05-10 5:57:15
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!