Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

The CLIP Command

Jun
552
4
Now I'm trying to understand the new (since version 27) CLIP command, and I'm puzzled.

The help specifies the following format:

CLIP [/C clipn: /R n /S clipn: /Z text]

This suggested to me that one can combine the options, and there is no place in the help text that specifies otherwise. However, that does not work. If only one (or none) of the options is allowed, then the help should state so, and the "text" part should appear after "/S clipn:" and before "/Z".

Moreover, I can enter all kinds of commands that don't work but give no syntax error, such as

clip /c clip2: /r 1

It looks as though the /C option is processed and the rest ignored, but I would have expected a syntax error (or something in the help text stating that extraneous material is ignored).

Another odd one is clip new text, which displays two lines of "CLIP0:" (one for each word in the extraneous text, suggesting that each word is being processed in some way) without changing the contents of the clipboards.

Is there a reason why one actually has to spell out the full "clipn:" instead of just specifying the number, such as clip /c 2 (or maybe alternately clip /c2)? If there is no reason, I would suggest this as an enhancement to the command, as well as

clip /s 2 text or clip /s2 text.

The output from CLIP with no argument can be rather confusing when clipboards contain more than a single line of text (as I discovered rather dramatically after I copied the output of the clip command to the clipboard and then ran clip). That led me to write clp.btm to display each clipboard with a banner line and an "echo." to terminate any contents without a final CRLF. Here's an example of the output:

========== Clipboard 0: ========== clip /c clip2: /r 1 ========== Clipboard 1: ========== CLIP [/C clipn: /R n /S clipn: /Z text] ========== Clipboard 2: ========== ========== Clipboard 3: ========== clipboard 2 ========== Clipboard 4: ========== ========== Clipboard 5: ========== ========== Clipboard 6: ========== ========== Clipboard 7: ========== ========== Clipboard 8: ========== ========== Clipboard 9: ==========

Perhaps the command clip should format the output more clearly.
 
Now I'm trying to understand the new (since version 27) CLIP command, and I'm puzzled.

The help specifies the following format:

CLIP [/C clipn: /R n /S clipn: /Z text]

This suggested to me that one can combine the options, and there is no place in the help text that specifies otherwise. However, that does not work. If only one (or none) of the options is allowed, then the help should state so, and the "text" part should appear after "/S clipn:" and before "/Z".

Most (all?) of the options probably make no sense when combined (unless you're trying to obfuscate your code). But I will make that clearer in the help.

Another odd one is clip new text, which displays two lines of "CLIP0:" (one for each word in the extraneous text, suggesting that each word is being processed in some way) without changing the contents of the clipboards.

No, since your arguments are both invalid, CLIP is defaulting to CLIP0: and displaying the CLIP0:
contents.

Is there a reason why one actually has to spell out the full "clipn:" instead of just specifying the number, such as clip /c 2 (or maybe alternately clip /c2)? If there is no reason, I would suggest this as an enhancement to the command, as well as

clip /s 2 text or clip /s2 text.

Post it in the suggestions forum. (Personally I think it makes the line more difficult to read.)

Perhaps the command clip should format the output more clearly.

?? Seems pretty clear to me - what would you prefer? (I'm not likely to change the default behavior, since it could break existing batch files / aliases.)
 
Most (all?) of the options probably make no sense when combined (unless you're trying to obfuscate your code). But I will make that clearer in the help.

It seems to me that some of the combinations are perfectly sensible (others, I agree, do not make sense). For example, one might want to clear the entire clipboard array and then put data into at least one of them:

clip /z /s clip2: Text for clipboard 2

Of course, there's not much reason why this should not be done using a sequence of separate commands.

No, since your arguments are both invalid, CLIP is defaulting to CLIP0: and displaying the CLIP0:
contents.

Shouldn't invalid commands produce an error message? For example, when I issue dir /y, I get a "parameter is incorrect" message with a syntax display. The command clip /w does not produce an error message. Now I see what you mean by "defaulting to CLIP0:". The help does not include a description of that syntax option clip clipn:. I now see how it works, and it is one case where multiple options can be supplied:

clip clip0: clip4:

However, it seems strange and confusing to treat arbitrary words that are syntactically wrong as if they were "clip0:".

Post it in the suggestions forum. (Personally I think it makes the line more difficult to read.)

I find that odd, since in the @CLIP function one uses just a number to designate the clipboard to use (e.g., from the help: %@clip[0,7]). By your argument, it would be easier to read as %@clip[0,clip7:] (and I suppose that it arguably is, since one can tell which parameter is the clipboard identifier and which is the line number).

Since there was apparently no essential reason for the usage of "clipn:" in CLIP, I will consider posting a suggestion.

In addition, since I'm still trying to understand what the clipboards are used for, let me ask this: Would it make sense to allow the following syntax to load the contents of a file into a clipboard? (I do realize that one can use redirection to accomplish the same thing -- unless redirection has been turned off.)

clip /s clip7: @file
 

Similar threads

Replies
4
Views
849
Back
Top