1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
<html> |
<html> |
4 |
<head> |
<head> |
5 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
6 |
<title>clipb2var</title> |
<title>clipb2var</title> |
7 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
</head> |
</head> |
10 |
|
|
11 |
<body> |
<body> |
12 |
|
|
13 |
|
|
14 |
<h1>clipb2var</h1> |
<h1>clipb2var</h1> |
15 |
|
|
16 |
<p> |
<p> |
17 |
Copies the text data of clipboard. |
Copies the text data of clipboard. |
18 |
</p> |
</p> |
19 |
|
|
20 |
<pre class="macro-syntax"> |
<pre class="macro-syntax"> |
21 |
clipb2var <strvar> [<offset>] |
clipb2var <strvar> [<offset>] |
22 |
</pre> |
</pre> |
23 |
|
|
24 |
<h2>Remarks</h2> |
<h2>Remarks</h2> |
25 |
|
|
26 |
<p> |
<p> |
27 |
Copies the text data in clipboard to <strvar>.<br> |
Copies the text data in clipboard to <strvar>.<br> |
28 |
If clipboad content is too long, copied data was truncated. (cf. <a href="../syntax/types.html#String">maximum length of a string</a>)</br> |
If clipboad content is too long, copied data was truncated. (cf. <a href="../syntax/types.html#String">maximum length of a string</a>)</br> |
29 |
If offset is specified, copied string starts offset*255-1 bytes. |
If offset is specified, copied string starts offset*255-1 bytes. |
30 |
</p> |
</p> |
31 |
|
|
32 |
<p> |
<p> |
33 |
The "clipb2var" command returns one of the following values in the system variable "result": |
The "clipb2var" command returns one of the following values in the system variable "result": |
34 |
</p> |
</p> |
35 |
|
|
36 |
<table> |
<table> |
37 |
<tr> |
<tr> |
38 |
<th>Value</th> |
<th>Value</th> |
39 |
<th>Meaning</th> |
<th>Meaning</th> |
40 |
</tr> |
</tr> |
41 |
|
|
42 |
<tr> |
<tr> |
43 |
<td>0</td> |
<td>0</td> |
44 |
<td>Could not open the clipboard. Or the clipboard content was not a text data. Or the offset value was invalid.</td> |
<td>Could not open the clipboard. Or the clipboard content was not a text data. Or the offset value was invalid.</td> |
45 |
</tr> |
</tr> |
46 |
|
|
47 |
<tr> |
<tr> |
48 |
<td>1</td> |
<td>1</td> |
49 |
<td>Copying to <strvar> is successful.</td> |
<td>Copying to <strvar> is successful.</td> |
50 |
</tr> |
</tr> |
51 |
|
|
52 |
<tr> |
<tr> |
53 |
<td>2</td> |
<td>2</td> |
54 |
<td>Copied string was truncated. If you want to read a truncated data, increment a offset value and execute a clipb2var comannd again.</td> |
<td>Copied string was truncated. If you want to read a truncated data, increment a offset value and execute a clipb2var comannd again.</td> |
55 |
</tr> |
</tr> |
56 |
|
|
57 |
<tr> |
<tr> |
58 |
<td>3</td> |
<td>3</td> |
59 |
<td>Could not allocate a memory to copy a clipboard content.</td> |
<td>Could not allocate a memory to copy a clipboard content.</td> |
60 |
</tr> |
</tr> |
61 |
</table> |
</table> |
62 |
|
|
63 |
<h2>Example</h2> |
<h2>Example</h2> |
64 |
|
|
65 |
<pre class="macro-example"> |
<pre class="macro-example"> |
66 |
clipb2var data |
clipb2var data |
67 |
messagebox data 'clipboard data' |
messagebox data 'clipboard data' |
68 |
</pre> |
</pre> |
69 |
|
|
70 |
<pre class="macro-example"> |
<pre class="macro-example"> |
71 |
; read a clipboard content and write it to a file. |
; read a clipboard content and write it to a file. |
72 |
fileopen fp 'clipboard.txt' 0 |
fileopen fp 'clipboard.txt' 0 |
73 |
if result <> 0 end |
if result <> 0 end |
74 |
|
|
75 |
offset = 0 |
offset = 0 |
76 |
do |
do |
77 |
clipb2var buff offset |
clipb2var buff offset |
78 |
if result > 0 filewrite fp buff |
if result > 0 filewrite fp buff |
79 |
offset = offset + 1 |
offset = offset + 1 |
80 |
loop while result = 2 |
loop while result = 2 |
81 |
|
|
82 |
fileclose fp |
fileclose fp |
83 |
</pre> |
</pre> |
84 |
|
|
85 |
</body> |
</body> |
86 |
</html> |
</html> |