?? 列表6.7.txt
字號:
【列表6.7】摘錄自frmRunAt.pas的程序代碼。
procedure TRunAtMainForm. WriteSchedule;
const
READ_IOMode = 'r'; { read mode from pipe }
WRITE_IOMODE = 'w'; { write mode from pipe }
var
Command : array[0..128] of char;
CmdLineArr : array[0..512] of char;
CmdLine : String;
ParamArr : array[0..512] of char;
Params : String;
F : PIOFile;
ErrNum : Integer;
begin
CmdLine := ' ';
Params :=' ';
if CreateCommandline(CmdLine, Params)
then begin
if FileRB.Checked
then begin { pass the file name on the command line }
errormessage(CmdLine);
StrCopy(Command, 'at ');
StrPCopy(CmdLineArr, CmdLine);
StrCat(Command, CmdLineArr);
F := popen(Command, READ_IOMode);
ErrNum := pclose(F);
if ErrNum <> -1
then MessageDlg('Success'. 'Your event has been '
+'scheduled', mtInformation. [mbOK]. 0)
else ErrorMessage('Error encountered while trying to '
+ 'close pipe to "at" utility');
end
else begin { Send the params via stdin }
StrCopy(Command, 'at ');
StrPCopy(CmdLineArr, CmdLine);
StrCat(Command, CmdLineArr);
StrPCopy(ParamArr, Params);
F := popen(Command, WRITE_IOMode);
fputs(ParamArr, F); { write the params line }
fputc(ord(LF), F); { write the newline }
fputc(ord(EOT), F); { write the EOT }
ErrNum := pclose(F);
if ErrNum <> -1
then MessageDlg('Success', 'Your event has been '
+'scheduled', mtInformation, [mbOK], 0)
else ErrorMessage('Error encountered while trying to
end;
end
else ErrorMessage('Unable to schedule the event');
end;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -