I'm using the code below in my project. When I print all of these fixed
length string variables, one per line, they strings in questions do not
properly pad with 0s. strQuantity prints as " 4". Six spaces than the
value of intQuantity. This is correct.
But all the others end up being string objects of only 6 characters long
(with the exception of strTotal). The left most positions of the string
object are being padded with one too few spaces. How is this possible?
Dim curTicketPrice As Currency
Dim strTicketPrice As String * 7
Dim intQuantity As Integer
Dim strQuantity As String * 7
Dim curFee As Currency
Dim strFee As String * 7
Dim curSubtotal As Currency
Dim strSubtotal As String * 7
Dim curDiscount As Currency
Dim strDiscount As String * 7
Dim curTaxes As Currency
Dim strTaxes As String * 7
Dim curTotal As Currency
Dim strTotal As String * 7
intQuantity = 4
curTicketPrice = 150.00
curFee = 30.00
curSubtotal = 630.00
curDiscount = 60.00
curTaxes = 85.80
curTotal = 655.50
RSet strQuantity = Format(intQuant ity, "General Number")
RSet strTicketPrice = Format(curTicke tPrice, "fixed")
RSet strFee = Format(curFee, "fixed")
RSet strSubtotal = Format(curSubto tal, "fixed")
RSet strDiscount = Format(curDisco unt, "fixed")
RSet strTaxes = Format(curTaxes , "fixed")
RSet strTotal = Format(curTotal , "currency")
<Ade
--
Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
Want to know the purpose of life? I'd be happy to share it with you...
length string variables, one per line, they strings in questions do not
properly pad with 0s. strQuantity prints as " 4". Six spaces than the
value of intQuantity. This is correct.
But all the others end up being string objects of only 6 characters long
(with the exception of strTotal). The left most positions of the string
object are being padded with one too few spaces. How is this possible?
Dim curTicketPrice As Currency
Dim strTicketPrice As String * 7
Dim intQuantity As Integer
Dim strQuantity As String * 7
Dim curFee As Currency
Dim strFee As String * 7
Dim curSubtotal As Currency
Dim strSubtotal As String * 7
Dim curDiscount As Currency
Dim strDiscount As String * 7
Dim curTaxes As Currency
Dim strTaxes As String * 7
Dim curTotal As Currency
Dim strTotal As String * 7
intQuantity = 4
curTicketPrice = 150.00
curFee = 30.00
curSubtotal = 630.00
curDiscount = 60.00
curTaxes = 85.80
curTotal = 655.50
RSet strQuantity = Format(intQuant ity, "General Number")
RSet strTicketPrice = Format(curTicke tPrice, "fixed")
RSet strFee = Format(curFee, "fixed")
RSet strSubtotal = Format(curSubto tal, "fixed")
RSet strDiscount = Format(curDisco unt, "fixed")
RSet strTaxes = Format(curTaxes , "fixed")
RSet strTotal = Format(curTotal , "currency")
<Ade
--
Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
Want to know the purpose of life? I'd be happy to share it with you...
Comment