How to display Text in new line in CoDesys visualization - codesys

In CoDeSys visualization, how to display Text in newline.
I have a csv file which reads by CoDeSys and display the csv column text in CoDesys rectangle text block.
In csv file I tried giving $N, \n\r,\n, no chance

To define a new line you have to type '$N'. Example: 'Hello$NWorld'
I hope it works!

From:
http://infosys.beckhoff.de/english.php?content=../content/1033/TcPlcControl/HTML/TcPlcVisu_edit_configElement.htm&id=
one learns:
"With the key combination Crtl+Enter you can insert line breaks, with Crtl+Tab, tab stops."
So, press Crtl+Enter to start a new line and check how CoDeSys separates lines. Hope it helps.

Related

NatTable - copy & paste cell data with line separator inside cell

My copy & paste works well for Nattables. Problem comes, if some cell contains line separator. When I paste data, line separator is taken as a row separator and structure of my table is destructed.
In CopyDataToClipboardCommand.class:
public CopyDataToClipboardCommand(String cellDelimeter,
String rowDelimeter, IConfigRegistry configRegistry) {
this.cellDelimeter = cellDelimeter;
this.rowDelimeter = rowDelimeter;
this.configRegistry = configRegistry;
}
cellDelimeter is set to \t and rowDelimeter is set to \r\n.
Inside problematic cells is new line set with \n. Any idea about this?
If you talk about pasting to Excel for example, then the issue is not in NatTable, it is in Excel. Excel treats a new line character as a row delimiter. The configuration in CopyDataToClipboardCommand is used to add that character for ADDING a new row.
If you want to be able to copy cell content that contains new line characters and paste it in Excel, you probably need to override CopyDataCommandHandler#internalDoCommand() and use a custom serializer that replaces the new line characters in the cell to something Excel can handle. Actually I don't know what character is treated as a line separater inside a cell in Excel. I probably would replace it with a simple space then.

String output to MS-WORD has too many new lines

This is my program window... The box in questions is the one labeled "INVESTIGATION" and "DISPOSITION".
When text is entered into the multiline textbox it is output in the DOCX file and it adds extra new lines... If a line is entered right below the original line it is a single extra new line. If it is spaced by one line it adds in two new lines. I figure it is something with the textbox properties or the output argument not playing well with the string. I have included pictures of the Form as it looks to the user. The builder code. The word document which shows the problem and the textbox properties. I want new lines in the investigation and disposition textbox to display how they are in the GUI and not have the extra new line. Any pointers?
I cant post images yet but you can view the images at the DOCX discussion board here https://docx.codeplex.com/discussions/658603
I hope its clear that I want it to display just as it is in the GUI:
A
A
A
should not look like it does in the last image where it is:
A
A
A
Thanks for all the help!

Line breaks using dlmcell in Matlab - shows up in Notepad++ but not Notepad

I am using the function dlmcell in Matlab to output text. I want text on a new line each time I append using dlmcell.
When I open my written document in Notepad++, each snippet of text is on a new line as I want it. However, opening it in Notepad that comes with windows, everything is on the same line. Can somebody tell me why this is, and how to fix it?
I'm assuming you're using the string \n to declare a new line in your output. For Notepad++ this is sufficient, because it interprets a new line just with \n. For the Windows Editor you need to include the carriage return also:
substitute:
\n with \r\n
This way not just a new line is created, it also tells the editor to actually continue on the next line.
To illustrate what I mean, open your output file with Notepad++ and activate View > Show Symbol > All characters and you will see something like:
I wrote this with Notepad++ and it automatically adds CR (carriage return) and LF (line feed) at the end of every line. Matlab doesn't if you don't tell it. So your output file only contains LF without the above mentioned substitution.
I've had a look into dlmcell, which is a FEX-function. In the current version \r\n is implemented actually. Do you have the newest version of that function (Download)? If not, something else must be wrong, please post some code.

tinymce removes line breaks so all text is in a continuous chunk with no paragraphs

I'm using TinyMce textarea editor and have a problem. As you probably know Tinymce transforms a standard html textarea into a rich text editor.
On our 'edit listing' page we call up some text from our db for the user to edit (previously in a standard textarea, now in the tinymce textarea.
Previously the standard textarea would preserve linebreaks and the user would get several paragraphs of text in the text area, now with tinyMCE they get a huge chunk of text with no linebreaks. (I have pasted an example of an entry in our db below - as you can see it has line breaks in it by tinymce seems to be ignoring them when it displays them in the editor).
Just to clarify my issue is now that tinymce is stripping something when I submit the form, it's that when I pull text (that contains line breaks) from the db and populate the tinymce textarea with that data (for the user to edit) in the tinymce textarea - the text appears (in the tinymce textarea) as one massive chunk of text with my paragraphs (whereas in a standard textarea it is nicely formatted with linebreaks)
Any help on how to resolve this would be greatly appreciated - do I need to use some sort of populate() type function to put the text in, or maybe I need to replace all the linebreaks with a different special character that tinyMCE will recognise as a line break and preserve?..
Thanks in advance.
Nick
example from db:
Here is line one
Here is line two
And here is line three
Which appears in tinymce as:
Here is line one Here is line two And here is line three
I faced a similar a problem, a while back and had questions just like yours. Also I finally ended up on SE just like you.
Anyway, I think I have the solution to your problem. If you are using PHP as your server side language, then you should use nl2br() PHP function.
Suppose you have stored your content fetched from the database in a php variable. Something like this:
$content = $row['content'];
Now when displaying it on to your screen, use the nl2br() function.
echo nl2br("<p>".$content."<p>");
Now, this part inside () depends on how you want to output the data. And I will leave it to you to figure that part out.
Hope this helps.

Matlab text object carriage return issue + text outside graph

I'm trying to show some text on top of a plot. Using
text(13,15200,('~ 12h'),'HorizontalAlignment','right','VerticalAlignment','middle','FontSize',10,'FontAngle','italic');
I can create the text box how I want it. But a thing I didn't manage to do is to create a carriage return within that text object. Already tried to add '\r' or '\n' but the only thing I get is the display of '\r' or '\n' with out breaking the line. Any ideas?
And i now that text object are used to put text WITHIN axes. But I am still trying to find a way to put some text outside the grap. Searching stackoverflow I found this Post about using UICONTROL. It works great but when I export to EPS the text seems to be in pixel format and NOT vector - so it looks really bad. Is there another way besides using uicontrol??
Thanks a lot for help!
In text that is not interpreted, you can specify line breaks using the carriage return character, which has the ascii code 10.
text(x,y,sprintf('break after this%snew line here',char(10)));
To allow text outside axes, you need to turn off clipping for the text object
text(x,y,.....,'clipping','off')