How can I enter a new-line character "\n" in the Strings.xls template?

Description:

If you need to enter a "\n" in a string of our Excel template "Strings.xls" to get an explicit new line character within a multiline text, the "\n" is displayed in the EmWi text as readable text, but it does not cause a new line in the text.

 

Solution:

The reason for this behavior is the default implementation of the string generation macro in older versions of our Excel template "Strings.xls". The Visual Basic macro within the document "Strings.xls" has automatically extends "\" to "\\" to have the backslash always generated as readable character in the generated string.

If you want to enter a new line character in older versions of our Excel template "Strings.xls" you need to change the default behavior by commenting out line 118 and 119 of the Visual Basic macro "Strings.xls!Tabelle1.ExportStrings".

 

117: ' <\> backslash sign has a special notation in ewu file 
118: ' ElseIf (charVal = 92) Then 
119: '   Print #1, "\" & Chr(charVal);

This is already changed in the actual version of our Excel template. Therfore we want to encourage you, always to use the latest version of our Software, Examples and documentations.

Note: After the described changes you are not able to enter a backslash in readable form. To get a backslash visible you need to enter "\\". Then a single backslash "\" is displayed in the generated string.

 

See also:

HowTo document [HT-007-Excel_String_Table_Import.pdf]

 

Keywords:

string, character, import, missing, new line, line feed, backslash, symbol, \n, generate, Excel

 

Last update on 2010-08-19 by Mario Stefanutti.

Go back