File: get-message.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,124 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
get-message \-  (messages)
.SH PURPOSE
Get string produced by writing a message.

.SH SYNTAX

.RS 4
.EX

get-message <message> to <string>

.EE
.RE

.SH DESCRIPTION
get-message will create a <string> from <message> which must have been created with \fBnew-message\fP. <string> can then be used elsewhere, for instance sent with a remote call (see \fBrun-remote\fP), written to a file etc.

Once get-message is called, <message> is initialized as if it was just created with \fBnew-message\fP without the "from" clause.

.SH EXAMPLES

.RS 4
.EX

// Create a message
new-message msg
// Write data
write-message msg key "key1" value "value1"
// Get string from message
get-message msg to str
\[char46]..
// Create a new message from string
new-message new from str
// Read data
read-message new key k value v
// Display  data
print-format "[%s] [%s]\en", k,v

.EE
.RE

The result is:

.RS 4
.EX

[key1] [value1]

.EE
.RE

.SH SEE ALSO
 Messages

\fBget-message\fP  
\fBnew-message\fP  
\fBread-message\fP  
\fBSEMI\fP  
\fBwrite-message\fP   
See all 
\fBdocumentation\fP