File: exit-handler.2gg

package info (click to toggle)
golf 601.4.41-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,824 kB
  • sloc: ansic: 20,020; sh: 1,171; makefile: 292
file content (82 lines) | stat: -rw-r--r-- 1,342 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.TH GOLF 2gg $VERSION $DATE Development Tools
.SH NAME
exit-handler \-  (program-flow)
.SH PURPOSE
Exit current request processing.

.SH SYNTAX

.RS 4
.EX

exit-handler [ <request status> ]

.EE
.RE

.SH DESCRIPTION
Exits current request by transferring control directly after the top-level \fBrequest\fP dispatcher. If there is an \fBafter-handler\fP, it will still execute, unless exit-handler is called from \fBbefore-handler\fP.

<request status> number is a request status returned to the caller (see \fBexit-status\fP); if not specified, then it's the value specified in the last executed exit-status statement; if none executed, then it's 0.

.SH EXAMPLES
Returning status of 20:

.RS 4
.EX

begin-handler /req-handler public
    ...
    exit-status 20
    ...
    exit-handler
    ...
end-handler

.EE
.RE

Returning status of 0:

.RS 4
.EX

begin-handler /req-handler public
    ...
    exit-handler
    ...
end-handler

.EE
.RE

Returning status of 10:

.RS 4
.EX

begin-handler /req-handler public
    ...
    exit-handler 10
    ...
end-handler

.EE
.RE

.SH SEE ALSO
 Program flow

\fBbreak-loop\fP  
\fBcall-handler\fP  
\fBcode-blocks\fP  
\fBcontinue-loop\fP  
\fBdo-once\fP  
\fBexit-handler\fP  
\fBif-defined\fP  
\fBif-true\fP  
\fBquit-process\fP  
\fBreturn-handler\fP  
\fBstart-loop\fP   
See all 
\fBdocumentation\fP