.BG
.FN .First
.FN .Last
.TL
Startup and Wrapup Actions
.CS
\&.First()
\&.Last()
.PP
The
.Co .First
function (or expression) is called (or evaluated) when S is started.
It is used for its side effects:
attaching directories, setting options and printing messages are
examples.
The
.Co .Last
function (or expression) is called (or evaluated) when S is about to exit
normally.
It is not executed if S terminates abnormally.
It should always be present, and should, at the very least,
execute the C program
.Co gr_wrap
to wrap up any graphics as illustrated in the example.
.EX
\&.First <- function() cat("Hello, Welcome to S\\n")
\&.Last <- function(){
	if(exists(".Device")) .C("gr_wrap")
	cat("Bye bye.\\n")
}
.KW data
.KW device
.KW programming
.WR
