File: set-param.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 (77 lines) | stat: -rw-r--r-- 1,411 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
.TH GOLF 2gg $VERSION $DATE Development Tools
.SH NAME
set-param \-  (request-data)
.SH PURPOSE
Set or create a parameter.

.SH SYNTAX

.RS 4
.EX

set-param ( <name> [ = <value> ] ) , ...

.EE
.RE

.SH DESCRIPTION
set-param sets or creates parameter <name> (see \fBget-param\fP). 

If parameter <name> does not exist, it's created with <value>. If it does exist, its value is replaced with <value>. Note that <value> can be of any type. 

If equal sign ("=") and <value> are omitted, then <value> is the same as <name>, so:

.RS 4
.EX

set-param something

.EE
.RE

is the same as:

.RS 4
.EX

set-param something = something

.EE
.RE

where the first "something" is the parameter set/created, and the second "something" is an actual variable in your code. In this example, the two just happen to have the same name; this generally happens often, so this form is a shortcut for that.

You can specify any number of parameters separated by a comma, for instance in this case par1 is a boolean, par2 is a number and par3 is a string:

.RS 4
.EX

set-number par2 = 10
set-param par1=true, par, par3="hi"

.EE
.RE


.SH EXAMPLES
Set the value of parameter "quantity" to "10", which is also the output:

.RS 4
.EX

set-param quantity = "10"
\[char46]..
get-param quantity
print-out quantity

.EE
.RE

.SH SEE ALSO
 Request data

\fBget-param\fP  
\fBrequest-body\fP  
\fBset-param\fP   
See all 
\fBdocumentation\fP