Re:Format Command
"Paul Nations" <
pauln@adhe.arknet.nospam.edu>wrote in message
Quote
Yes. It would appear the programmer wanted it exactly 35 chars long. It's
being output to a printer with Courier font.
I think your command is the best solution to let the next guy who opens this
thing (hopefully me) know what's going on.
Oops, hit send on an empty message! :-P
I just wanted to add that one of the advantages of an extendable language
is that you can make it so your intentions are clear, even when the language
to do so may be obscure:
Printer.Print LeftAlign(CustName, 35)
There would be very little guesswork about what that might mean. And just
for completeness, here are two candidates for LeftAlign and RightAlign:
Public Function LeftAlign(ByRef Text, Optional Length As Long = 0) As String
Length = Abs(Length)
If Length = 0 Then Length = Len(Text)
LeftAlign = Left$(LTrim$(Text) & Space$(Length), Length)
End Function
Public Function RightAlign(ByRef Text, Optional Length As Long = 0) As String
Length = Abs(Length)
If Length = 0 Then Length = Len(Text)
RightAlign = Right$(Space$(Length) & RTrim$(Text), Length)
End Function
HTH
LFS
-