pjohns
9th January 2006, 12:48
Hello,

I have a report which is used to generate a payment file to our Bank. An example of the code is below.

print.string = shiftl$(strip$(tfcmg001.bano)) & "," & tfcmg001.ccur.......

I have to make a change to the report which will output my file with double quotes around each field. i.e. "123456","EUR"

What is the syntax, using the example above, to encase my fields with ""?

I tried print.string = shiftl$(strip$("tfcmg001.bano")) & "," & "tfcmg001.ccur" but this gave me tfcmg001.bano,tfcmg001.ccur

Thanks

PJ

Marc van Kessel
9th January 2006, 13:50
You can use double quotes inside a string to use
the quote character.

print.string = shiftl$(strip$("tfcmg001.bano")) & "," & """tfcmg001.ccur"""

you can also use the ascii table, chr(34) I think.

Best regards,

Marc

Marc van Kessel
9th January 2006, 13:55
sorry, I didn't read the example properly, you probably need:

print.string = """" & shiftl$(strip$("tfcmg001.bano")) & """,""" & tfcmg001.ccur & """"

pjohns
9th January 2006, 13:56
Thanks Marc,

This gives me what I want.

Regards

PJ

csecgn
9th January 2006, 13:58
print.string = """ & shiftl$(strip$(tfcmg001.bano)) & "","" & tfcmg001.ccur & """ (if I counted the " correct. The rule is "" gives a " in the resultstring)


or

print.string = chr$(34) & shiftl$(strip$(tfcmg001.bano)) & chr$(34) & "," chr$(34) & tfcmg001.ccur & chr$(34)

Regards
csecgn