LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
ouadji

Rotate String

Status: New

 

                     this time, I hope this idea was not already proposed! Smiley Frustrated

 

 

original6.png

 


3 Comments
X.
Trusted Enthusiast
Trusted Enthusiast

ScreenHunter_006.jpg

QFang
Active Participant

As a question to X.'s suggestion:

 Is it correct to say that the "string to byte array" and "byte array to string" simply change how we choose to view the data (no data or structure change) and as such there is extremely low (no?) overhead with these functions? I would hope the compiler can do it that way.. (I have wondered this many times, but never could be bother to benchmark or ask before..)

If that is the case (very low/no overhead) then I don't see much point in making that functionality a new palette item, but on the other hand it would be a very easy thing for NI to do..

 

 

QFang
-------------
CLD LabVIEW 7.1 to 2016
X.
Trusted Enthusiast
Trusted Enthusiast

My point in suggesting the obvious was that there is very little code to write to get the desired functionality. Personally, I never had to rotate a string, but I would suspect that this is a pretty rare need.

As far as what the function does, I can only guess, but strictly speaking, in other languages, a string is not JUST a byte array (see for instance this discussion). However, to confuse things a bit, if you look at the allocated buffers in the code below:

 

ScreenHunter_005.jpg

 

there does not seem to be any buffer allocated specifically for the string to U8 operation; you get the same buffer allocation in this situations:

 

ScreenHunter_008.jpg

 

and there is certainly none in the reverse operation:

 

ScreenHunter_009.jpg

 

This being said, even if there was data copy, these are only strings... so unless you want to rotate the Encyclopedia Britannica (and even then!), I really wouldn't worry about overhead issues...