File: set-bool.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 (63 lines) | stat: -rw-r--r-- 1,241 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
.TH GOLF 2gg $VERSION $DATE Development Tools
.SH NAME
set-bool \-  (booleans)
.SH PURPOSE
Set value of a boolean variable.

.SH SYNTAX

.RS 4
.EX

set-bool <var> [ = <boolean> ] [ process-scope ]

set-bool <var> from-condition <condition>

.EE
.RE

.SH DESCRIPTION

.LP
.B WITHOUT "FROM-CONDITION" CLAUSE
.LP

If "from-condition" clause is not used, boolean variable <var> is either assigned value <boolean> with "=" clause, or it is assigned "false" if equal clause ("=") is omitted.

If "process-scope" clause is used, then boolean is of process scope, meaning its value will persist from one request to another for the life of the process. 

.LP
.B WITH "FROM-CONDITION" CLAUSE
.LP

If "from-condition" clause is not used, then <condition> is evaluated, and if true, then "true" value is assigned to <var>, otherwise "false" is assigned. See \fBif-true\fP for more on <condition>.

.SH EXAMPLES
Assign "true" value to boolean variable "my_bool":

.RS 4
.EX

set-bool my_bool = true

.EE
.RE

Assign boolean value based on condition:

.RS 4
.EX

\[char46]..
set-bool my_bool from-condition num1 equal num2 or str1 not-equal str2

.EE
.RE

.SH SEE ALSO
 Booleans

\fBboolean-expressions\fP  
\fBset-bool\fP   
See all 
\fBdocumentation\fP