📄 after.n
字号:
'\"'\" Copyright (c) 1990-1994 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) after.n 1.4 96/03/25 20:09:33'\" .so man.macros.TH after n 7.5 Tcl "Tcl Built-In Commands".BS'\" Note: do not modify the .SH NAME line immediately below!.SH NAMEafter \- Execute a command after a time delay.SH SYNOPSIS\fBafter \fIms\fR.sp\fBafter \fIms \fR?\fIscript script script ...\fR?.sp\fBafter cancel \fIid\fR.sp\fBafter cancel \fIscript script script ...\fR.sp\fBafter idle \fR?\fIscript script script ...\fR?.sp\fBafter info \fR?\fIid\fR?.BE.SH DESCRIPTION.PPThis command is used to delay execution of the program or to executea command in background sometime in the future. It has several forms,depending on the first argument to the command:.TP\fBafter \fIms\fR\fIMs\fR must be an integer giving a time in milliseconds.The command sleeps for \fIms\fR milliseconds and then returns.While the command is sleeping the application does not respond toevents..TP\fBafter \fIms \fR?\fIscript script script ...\fR?In this form the command returns immediately, but it arrangesfor a Tcl command to be executed \fIms\fR milliseconds later as anevent handler.The command will be executed exactly once, at the given time.The delayed command is formed by concatenating all the \fIscript\fRarguments in the same fashion as the \fBconcat\fR command.The command will be executed at global level (outside the contextof any Tcl procedure).If an error occurs while executing the delayed command then the\fBbgerror\fR mechanism is used to report the error.The \fBafter\fR command returns an identifier that can be usedto cancel the delayed command using \fBafter cancel\fR..TP\fBafter cancel \fIid\fRCancels the execution of a delayed command thatwas previously scheduled.\fIId\fR indicates which command should be canceled; it must havebeen the return value from a previous \fBafter\fR command.If the command given by \fIid\fR has already been executed thenthe \fBafter cancel\fR command has no effect..TP\fBafter cancel \fIscript script ...\fRThis command also cancels the execution of a delayed command.The \fIscript\fR arguments are concatenated together with spaceseparators (just as in the \fBconcat\fR command).If there is a pending command that matches the string, it iscancelled and will never be executed; if no such command iscurrently pending then the \fBafter cancel\fR command has no effect..TP\fBafter idle \fIscript \fR?\fIscript script ...\fR?Concatenates the \fIscript\fR arguments together with spaceseparators (just as in the \fBconcat\fR command), and arrangesfor the resulting script to be evaluated later as an idle callback.The script will be run exactly once, the next time the eventloop is entered and there are no events to process.The command returns an identifier that can be usedto cancel the delayed command using \fBafter cancel\fR.If an error occurs while executing the script then the\fBbgerror\fR mechanism is used to report the error..TP\fBafter info \fR?\fIid\fR?This command returns information about existing event handlers.If no \fIid\fR argument is supplied, the command returnsa list of the identifiers for all existingevent handlers created by the \fBafter\fR command for thisinterpreter.If \fIid\fR is supplied, it specifies an existing handler;\fIid\fR must have been the return value from some previous callto \fBafter\fR and it must not have triggered yet or been cancelled.In this case the command returns a list with two elements.The first element of the list is the script associatedwith \fIid\fR, and the second element is either\fBidle\fR or \fBtimer\fR to indicate what kind of eventhandler it is..LPThe \fBafter \fIms\fR and \fBafter idle\fR forms of the commandassume that the application is event driven: the delayed commandswill not be executed unless the application enters the event loop.In applications that are not normally event-driven, such as\fBtclsh\fR, the event loop can be entered with the \fBvwait\fRand \fBupdate\fR commands..SH "SEE ALSO"bgerror.SH KEYWORDScancel, delay, idle callback, sleep, time
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -