Jump to content

String copy strangeness


Recommended Posts

1 hour ago, crossrulz said:

It may be valid, but for any application that uses C-style strings, the NULL character ends the string.

Yes I know. But this is LabVIEW which does not have null terminated strings. That is what makes this strange. 

Link to comment
23 minutes ago, Neil Pate said:

Yes I know. But this is LabVIEW which does not have null terminated strings. That is what makes this strange. 

Yeah, but you are talking about pasting into other applications.  How are they interfacing with the clipboard?  We have no control over that.  You will see this same issue if you try to interact with a DLL that uses C-style strings (data will be cut off at the NULL character).

I should also state that the NULL is copied over if you paste into another LabVIEW string control (yes, I just tested it).

Link to comment
9 minutes ago, crossrulz said:

Yeah, but you are talking about pasting into other applications.  How are they interfacing with the clipboard?  We have no control over that.  You will see this same issue if you try to interact with a DLL that uses C-style strings (data will be cut off at the NULL character).

I should also state that the NULL is copied over if you paste into another LabVIEW string control (yes, I just tested it).

Nope. If I start with this same string in notepad or some other application it copies and pastes correctly. 

For example notepad to notepad++ works correctly. 

I classify this as a bug. The string in LabVIEW includes all the characters, it should copy them correctly. I don't think this is a limitation of the windows API 

Link to comment

LV to notepad++ doesn't work -> Notpad++ uses C style strings for the paste from clipboard.

LV to MS Word & Excel 365 doesn't work -> Same as above.

It seems the LV to LV path allows null in the middle of a string, while the LV to Windows path doesn't.

Link to comment

ok ok I take it all back. Seems like a Windows thing.

image.png.ef85dfe897a2c2925f5a1bfaabd649f5.png

Copying this from Notepad++ to Notepad results in this

image.png.5a581b62ad78b1642181e42db8d03ad1.png

which if I then copy back to Notepad++ I get this

image.png.9dd142fb95110ccc59f10d46af7984cb.png

I guess some applications sanitise the string before sending to the windows API.

Link to comment

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.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.