how to print in line

Hello

I am programming a reciept, and i want it to look like this (please look the the attached picture)

found out i should do that,

[code]Print "Product 1"; ' << semicolon at end prevents carriage return
Print vbTab; vbTab; "20.00$" ' << no semicolon at end will produce carriage return
[/code]


it works, but now i want the coulmn like the picture, i have that code, but i cant fix how to use it, someone can help?

[code]Dim Len1 As Int = 15
Dim Len2 As Int = 8

Function CreateString(ItemName, Amount) As String
Dim Str1 As String
If ItemName.Length > Len1 Then
Str1 = Str1 + Left(ItemName, Len1)
Else
Str1 = Str1 + PadRight(ItemName, Len1)
End If
Str1 = Str1 + " "
'Below code has been modified to make amounts right-justified
If Amount.Length <= Len2 Then
Str1 = Str1 + PadLeft(Amount, Len2)
End If
Str1 = Str1 + Left(Amount, Len2)
Return Str1
End Function
[/code]



thank you very much

[img=http://www.xtremevbtalk.com/attachment.php?attachmentid=31534&d=1294339006]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories