Jump to content
Macro Express Forums

Copying 'nothing' to the clipboard?


Recommended Posts

I was thinking along the lines Cory mentioned. My html editor adds a blank space (not  ) at the end of each line (which does not appear on the actual web page). None of my text editors seem to.

 

Re Unicode, this exercise was useful because now if I see the ANSI characters ÿþ I'll know why.

 

Re non-printing characters, I tried some hex values between 0 and 31 copied into a text variable. In those I tried, a character of some description appeared in the T variable (just like Unicode characters are changed when saving to ANSI format). The normal character I look out for particularly is a space. As Cory noted if you encase the variable in quotes in Text Box Display or other it makes it easier to see any erroneous characters like a space. I normally click at the end of the string. Hmmm, decisions. Which is less effort, two " or one mouse click?

 

Note to self: Next terrypin problem post, ask if rebooted in the last month

Link to comment
Share on other sites

Re non-printing characters, I tried some hex values between 0 and 31 copied into a text variable. In those I tried, a character of some description appeared in the T variable
I suppose it depends on the font you have selected, doesn't it? I used the default font of Tahoma and found 0, 10, and 13 (decimal)(Nul, LF, and CR) to appear the same as nothing. IE two quotes stacked together. What font were you using that appeared with something between the quotes for these? In Unix-ish programs the EoL is just LF. I know UltraEdit will support either and if you pick up a "Non-Windows" file it will work this way after warning you. And in some apps like Word when you clip it adds an EoL if the clip doesn't end with one. And if he had a Unicode file that might suggest a non-windows convention. I did a little checking and the Unicode standard requires that all applications accept any of 7 values for EoL. They are LF, CR, CR+LF, NEL, FF, LS, and PS according to the Wiki. So it sounds likely that a Unicode file might have a simple LF which would appear as nothing. Anyway my point is you can have a value in the variable and it can appear as nothing and the only explanation I can think of that explains what he was seeing in testing it that something was on his clipboard that appeared as nothing.
Link to comment
Share on other sites

What I was doing was loading a blank text file into a Hex Editor (both ANSI and Unicode files), manually changing the values eg Hex 05, 0E and exporting to the Clipboard. I then ran the back end of terrypin's macro to paste to T1 or T2 and display. I retried just now and seem to be getting ÿ (0xFF) most of the time. I'm going to have to terminate my involvement in this thread. I've spent too much time on it.

Link to comment
Share on other sites

It presumably comes down to the difference between 'empty' and 'null'. But it's a distinction I still don't grasp. In particular, what is the command If Clipboard Equals "" testing for, null or empty?

Sorry not to have responded earlier - I've been away.

The above command is testing for a zero-length string, not a null string, nor an empty string (whatever that means).

%tVar% = "this"

The variable tvar contains a string of 4 characters.

%tVar% = "thi"

The variable tvar contains a string of 3 characters.

%tVar% = "th"

The variable tvar contains a string of 2 characters.

%tVar% = "t"

The variable tvar contains a string of 1 character.

%tVar% = ""

The variable tvar contains a string of 0 characters.

Your If Clipboard command will return True to this, and only this, string (assuming this string is currently in the clipboard).

As far as ME is concerned, forget about the word null, as it has no meaning. And the term Empty is not at all useful.

 

String variables in ME always contain a string. The string can be from 0 to ? characters (I don't know what the upper limit is).

Integer variables always contain a number. That number is 0 if the variable has not yet been used.

 

Does that help?

 

As far as Textpad is concerned, it looks as if it may append a linefeed (represented by Ascii13 followed by Ascii10) to a zero-length string on the clipboard. or perhaps it always appends CrLf to the last character in the clipboard. You should be able to establish that fairly easily.

Link to comment
Share on other sites

Sorry not to have responded earlier - I've been away.

The above command is testing for a zero-length string, not a null string, nor an empty string (whatever that means).

...etc

 

Does that help?

 

Sure does, thanks Paul.

 

As far as Textpad is concerned, it looks as if it may append a linefeed (represented by Ascii13 followed by Ascii10) to a zero-length string on the clipboard. or perhaps it always appends CrLf to the last character in the clipboard. You should be able to establish that fairly easily.

 

It looks as if that was temporary behaviour, disappearing immdiately after a reboot. You've probably also now seen the author's response. But I'll have to watch out for a re-occurrence, as it can obviously play havoc if it goes undetected.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...