P
Pascal
hello
i try to use padright and padleft to beautify the aspect of my prints. I 'd
like the text to be print in two columns but i don't know the size of each
string before (because they are randomly generated) I thought that padright
complete the lenght of a string to the size noticed as a variable like
padright (50) if the string is 35 of lenght so padright add 15 to fit to
the given size of 50. But it seems it doesn't work like this ? Can some one
tell what doesn't work in this code ?
m_Paragraphs = New Collection
Dim mtEspaces As String = " = .......... "
For i As Integer = 1 To 20
Dim myStr1 As String = NbE(CShort(utility.GenNombre(Min, Max))) 'to build a
long number like 9 352
Dim myStr2 As String = NbE(CShort(utility.GenNombre(Min, Max))) 'to build a
long number like 9 352
m_Paragraphs.Add(New ParagraphInfo(11, i.ToString + ") ".PadRight(5) &
myStr1.PadRight(5) & mtEspaces.PadRight(50) & myStr2.PadRight(5) &
mtEspaces))
m_Paragraphs.Add(New ParagraphInfo(9, vbCrLf))
Next
the string are not aligned in two columns....
thanks for help
pascal
http://www.scalpa.info
i try to use padright and padleft to beautify the aspect of my prints. I 'd
like the text to be print in two columns but i don't know the size of each
string before (because they are randomly generated) I thought that padright
complete the lenght of a string to the size noticed as a variable like
padright (50) if the string is 35 of lenght so padright add 15 to fit to
the given size of 50. But it seems it doesn't work like this ? Can some one
tell what doesn't work in this code ?
m_Paragraphs = New Collection
Dim mtEspaces As String = " = .......... "
For i As Integer = 1 To 20
Dim myStr1 As String = NbE(CShort(utility.GenNombre(Min, Max))) 'to build a
long number like 9 352
Dim myStr2 As String = NbE(CShort(utility.GenNombre(Min, Max))) 'to build a
long number like 9 352
m_Paragraphs.Add(New ParagraphInfo(11, i.ToString + ") ".PadRight(5) &
myStr1.PadRight(5) & mtEspaces.PadRight(50) & myStr2.PadRight(5) &
mtEspaces))
m_Paragraphs.Add(New ParagraphInfo(9, vbCrLf))
Next
the string are not aligned in two columns....
thanks for help
pascal
http://www.scalpa.info