$cb » History » Version 6
Per Amundsen, 02/16/2023 09:14 PM
| 1 | 1 | Per Amundsen | _Added in 1.9.0_ |
|---|---|---|---|
| 2 | |||
| 3 | *$cb* |
||
| 4 | |||
| 5 | Returns the clipboard contents. |
||
| 6 | |||
| 7 | 3 | Per Amundsen | ----------------------------------------------------------------------------- |
| 8 | |||
| 9 | 5 | Per Amundsen | *$cb(N,[u,%var|&binvar])* |
| 10 | 1 | Per Amundsen | |
| 11 | Returns a line of text from the clipboard. |
||
| 12 | |||
| 13 | *Parameters* |
||
| 14 | |||
| 15 | 6 | Per Amundsen | table(ktable). |
| 16 | |*Parameter*|*Description*| |
||
| 17 | | N | If N = 0 returns total number of lines in the clipboard, if N = -1 returns all the text in the clipboard, otherwise return the Nth line in the clipboard. | |
||
| 18 | | u | Returns UTF-8 encoded text. (Optional) | |
||
| 19 | | %var<notextile>|</notextile>&binvar | Results are stored in them and the identifier returns the length of the text. (Optional) | |
||
| 20 | 1 | Per Amundsen | |
| 21 | *Properties* |
||
| 22 | |||
| 23 | 6 | Per Amundsen | table(ktable). |
| 24 | |*Property*|*Description*| |
||
| 25 | | .len | If N = 0 or -1 returns total length of all lines in the clipboard otherwise return length of the Nth line. | |
||
| 26 | 1 | Per Amundsen | |
| 27 | *Êxample* |
||
| 28 | |||
| 29 | <pre> |
||
| 30 | ;Return number of lines in the clipboard |
||
| 31 | //echo -ag $cb(0) |
||
| 32 | |||
| 33 | ;Return 5th line in the clipboard |
||
| 34 | //echo -ag $cb(5) |
||
| 35 | |||
| 36 | ;Return length of the 5th line in the clipboard |
||
| 37 | //echo -ag $cb(5).len |
||
| 38 | </pre> |