LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding spacing between array when exporting to Notepad

On piece of advice not related to the issue:

If you are displaying a constant, control, or indicator as something other than it's default format, make sure to make the display style (string) or radix (numeric) visible by right-clicking on the object and selecting Visible Items --> Display Style or Radix (as appropriate) so no one mistakes interpreting the data.

number 36.PNG

Ahh, the number 36.

 

number 36 hex.PNG

No!  it's actually 0x36!!!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 11 of 14
(494 Views)

@gmille wrote:

I was able to understand the different steps used in the shown program with the exception of 1 being the format string constant at the top. What does the %s do? Also i have noticed that there is a \ in front of the string constant, what does this do? When outputting my numbers now it does it all correctly but after a break to the new line (because of the \n if i understand it correctly?) it starts with a break like shown in the picture. Is this related to that \ at the front of the constant?

 

 


You can right-click the string constant and select the display style. I selected \-codes because some of the characters are not visible otherwise (now spaces show as \s, tabs as \t, newline characters as \n, etc. and you can tell the difference), You should also select "visible items...display style" to see the purple \, telling you what the display style actually is. (Note that the \s are regular spaces, so don't enter "\s" in normal display, or you get two characters.) So please go back and correct your string after setting the correct display style.

 

(Side note: formatting statements understand a limited set of \-codes even if they are in normal display. For me, it is cleaner if you skip those and use \-codes display instead. The problem in your example is that your last space character is in normal format, and thus not visible)

 

The display style is purely cosmetic and does not change the actual string content. It just makes it more clear what's there, especially when dealing with code images.

 

StringStyle.png

Looking at your image, you also seem to have an extra space after the \n, that's why all your lines except the first one are indented.

0 Kudos
Message 12 of 14
(484 Views)

Again, lotto numbers are integers. Your array needs to be blue, not orange. Right?

0 Kudos
Message 13 of 14
(479 Views)

@gmille wrote:

I was able to understand the different steps used in the shown program with the exception of 1 being the format string constant at the top. What does the %s do? Also i have noticed that there is a \ in front of the string constant, what does this do? When outputting my numbers now it does it all correctly but after a break to the new line (because of the \n if i understand it correctly?) it starts with a break like shown in the picture. Is this related to that \ at the front of the constant?


%s tells the Format Into String where to place to input string. See the LabVIEW help on Format Into String, especially the Format Specifiers section.

 


@gmille wrote:

I have looked at the type of the array and indeed it should come out as an array of integer values but it shows as an array of doubles, any way to change this without having to make a new array? Thanks again! 


Either right click a control\indicator, and set it's representation, or right click it and set it to Adapt To Type. Then make sure the type is an integer (I32 usually) by using the To Long Integer function.

0 Kudos
Message 14 of 14
(464 Views)