Strcat adding double quotes strangely

Started by MW4, January 07, 2016, 11:55:25 AM

Previous topic - Next topic

MW4

I have code that grabs a VIN number off of an invoice text file and inputs it into an access database.
Sometimes the Vin line is 17 digits and sometimes the line wraps and does 16 on one line and 1 on the next.

I set this code up her to handle that but when it's 17 digits and one line I get 12345678901234567 -- When it's on two lines I get "12345678901234567" It's erroring out because it's counting the double quotes as characters making it a 19 digit data going into a 17 digit field.
 
reads:

if strsub(ItemExtract(InvoiceLine+4, pdfdata, @LF), 1, 3) == "C/C"

Vin         = strsub(ItemExtract(InvoiceLine+3, pdfdata, @LF), 1, 17)

else

Vin16     = strsub(ItemExtract(InvoiceLine+3, pdfdata, @LF), 1, 16)
Vin01     = strsub(ItemExtract(InvoiceLine+4, pdfdata, @LF), 1, 1)
Vin         = strcat(Vin16, Vin01)

endif


I've also tried this line, same result  ------  Vin     = strcat(strsub(ItemExtract(InvoiceLine+3, pdfdata, @LF), 1, 16), strsub(ItemExtract(InvoiceLine+4, pdfdata, @LF), 1, 1))

Why are the double quotes being added only on the Strcat?

stanl

Could you possibly post a sample with the wrap of the 17th digit?

MW4


MW4