Documentation @clip

Aug 9, 2009
237
1
It appears @clip isn't working as I understand the Doc's or I don't understand the Doc's

Code:
echo %@clipw[0 First Line]
echo %@clipw[1 Second Line]
echo %@clip[0] - %@clip[1]
 
May 20, 2008
11,529
102
Syracuse, NY, USA
The docs don't come right out and say it, but @CLIPW doesn't append. Each @CLIPW starts at the beginning of the clipboard.

You can, of course, append with the likes of

Code:
echo foo >> clip:

But be careful. @CLIPW does not automatically put a newline in the clipboard either. So a subsequent ">> clip:" will likely be added at the end of the line written with @CLIPW.

Code:
v:\> echo %@clipw[1 First Line]
0

v:\> echo 2 Second Line >> clip:

v:\> type clip:
1 First Line2 Second Line
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,491
90
Albuquerque, NM
prospero.unm.edu
You can also write your own EOLs:

Code:
C:\>echo %@clipw[Line One^r^nLine Two^r^n]
0

C:\>type clip:
Line One
Line Two

C:\>echo %@clip[0] - %@clip[1]
Line One - Line Two

C:\>
 
Aug 9, 2009
237
1
I know Understand what @clip is doing the way I see it
each clipboard entry is its own entity

Thanks Charles, Vince
 

Similar threads