I'm working with VBScript to build a text email message. I'm seeing a variety of bizarre formatting issues. The following lines of code
MT = MT & vbCrLf & "Card Type: " & CardType
MT = MT & vbCrLf & "Credit Card Number: " & objBOWallet.Encrypt(Payment.[_account_number])
If Not IsNull(Payment.[_expiration_month]) Then
MT = MT & vbCrLf & "Expiration Month: " & Payment.[_expiration_month]
End If
If Not IsNull(Payment.[_expiration_year]) Then
MT = MT & vbCrLf & "Expiration Year: " & Payment.[_expiration_year]
End If
MT = MT & vbCrLf & "Payment Amount: " & Context.DataFunctions.Money(Payment.payment_amount )
results in the following text in the email:
Card Type: Visa
Credit Card Number: ?Hn<j;?AKPBROcTYPSiUjk Expiration Month: 7 Expiration Year: 2008 Payment Amount: $25.34
with Space characters where there should be CRLF characters. Changing the second line from
MT = MT & vbCrLf & "Credit Card Number: " & objBOWallet.Encrypt(Payment.[_account_number])
to
MT = MT & vbCrLf & "Credit Card Number: " & Tab(1) & objBOWallet.Encrypt(Payment.[_account_number])
(adding the Tab(1)) "fixes" the problem, but I can't see why. Why would a Tab character in one line impact the CRLF characters in three subsequent lines?
The most recent behavior is, to me, even more bizarre as I am now getting CRLF characters appearing in the middle of what are string literals in the code. For example, the following code
If Not IsNull(OrderForm.advcode) Then
MT = MT & vbCrLf & "Affilate or Advertising code:" & Tab(1) & Trim(OrderForm.advcode)
End If
If Not IsNull(OrderForm.Special_Offer) Then
MT = MT & vbCrLf & "Special Offer Code:" & Tab(1) & Trim(OrderForm.Special_Offer)
End If
MT = MT & vbCrLf & "Order Number:" & Tab(1) & OrderForm.OrderNumber
results in the following text in the email:
Affilate or Advertising code:Special
Offer Code:Order
Number: 10100625021
Instead of getting CRLF characters before the "Special Offer Code:" and "Order Number:" strings, there are CRLF characters inserted into the middle of each string. I can't make head nor tails of what's going on. Has anyone seen anything like this???