Hi team, I have a formatting problem. I try to explain myself.
I have a table that I’m reading values from… most of the values don’t expect a carriage return, but the ones that do need to be separated. For each value I have to write a dedicated line.
For values without carriage return the code works, for the others, they wrap and the formatting comes out all wrong. I try to write the code.
My Code:
Dim LunghezzaDescrizione as string 'String for single description no chr(13)
Dim words() As string 'Array
Dim PezzoStringa as string 'Temp string
For row As Integer = 0 To maxRow
LunghezzaDescrizione=""
LunghezzaDescrizione=ListBoxInventario.CellTextAt(row,7)
LunghezzaDescrizione=LunghezzaDescrizione.Left(70) ''''i need first 70 chars
LunghezzaDescrizione=LunghezzaDescrizione.ReplaceLineEndings(EndOfLine.Windows)
if LunghezzaDescrizione.Contains(chr(13)) =True then ' if i see goback char, create an array for any goback
words.RemoveAll
words = LunghezzaDescrizione.Split(chr(13)) 'create an array for any ch(13)
For i As Integer = words.FirstIndex To words.LastIndex 'print line for any array created
PezzoStringa=words(i)
tisx.WriteLine("\\\\\\\\\\\\\\\\\\\")
tisx.WriteLine(row.ToString + " ** " + PezzoStringa + " ** ")
Next
else
tisx.WriteLine("")
tisx.WriteLine(row.ToString + " ** " + LunghezzaDescrizione + " ** ")
end if
Next
For example, if there are 3 articles written in the same box on several lines, I have to write each article on a separate line, keeping the number of the position, like the number 273 in the example.
The problem is similar to line character remains memorized