BCB6 的 code , 要從命令列加參數來當做程式執行的條件
Example 摘錄自 help 檔 ParamCount, ParamStr Example …
The following example beeps once for each \”beep\” passed in on the command line. The example terminates the application if \”exxit\” is passed in on the command line.
void __fastcall TForm1::FormCreate(TObject *Sender)
{
for (int i=1;i<=ParamCount();i++)
{
if (LowerCase(ParamStr(i)) == \"beep\")
Beep(10000,1000);
elseif (LowerCase(ParamStr(i)) == \"exit\")
Application->Terminate();
}
}