Open-Source-Software-Entwicklung und Downloads

Browse Subversion Repository

Diff of /trunk/doc/en/html/macro/command/clipb2var.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3226 by maya, Tue Mar 24 09:37:20 2009 UTC revision 3227 by maya, Tue Mar 24 15:10:33 2009 UTC
# Line 1  Line 1 
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 &lt;strvar&gt; [&lt;offset&gt;]  clipb2var &lt;strvar&gt; [&lt;offset&gt;]
22  </pre>  </pre>
23    
24  <h2>Remarks</h2>  <h2>Remarks</h2>
25    
26  <p>  <p>
27  Copies the text data in clipboard to &lt;strvar&gt;.<br>  Copies the text data in clipboard to &lt;strvar&gt;.<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 &lt;strvar&gt; is successful.</td>    <td>Copying to &lt;strvar&gt; 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 &lt;&gt; 0 end  if result &lt;&gt; 0 end
74    
75  offset = 0  offset = 0
76  do  do
77      clipb2var buff offset      clipb2var buff offset
78      if result &gt; 0 filewrite fp buff      if result &gt; 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>

Legend:
Removed from v.3226  
changed lines
  Added in v.3227

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26