Page 1 of 1

Strange behaviour with string!

Posted: Wed May 14, 2014 5:43 pm
by wee wullie
Hi, I have a problem with a part of my code but this problem only occurs sometimes, I have a stack that updates an Excel file, this stack gets its data from my main stack,
basically what happens is this:

Code: Select all

rs("Comments") = "This person has demonstrated a very high level of skill and determination to complete the following training schedule to a satisfactory standard. 
"
i.e. the " is on another line and it needs to be like this:

Code: Select all

rs("Comments") = "This person has demonstrated a very high level of skill and determination to complete the following training schedule to a satisfactory standard."
I thought it was the length of the string at first, but I can send almost any length of string when I input the text directly into the Excel stack and send from there however the text input must come from my main stack, the strange part is that It doesn't always happen, any ideas would be very welcome.

weewullie

Re: Strange behaviour with string!

Posted: Wed May 14, 2014 7:13 pm
by robertem
I have not seen this while working with strings, do you have some code that demonstrates the problem?

Re: Strange behaviour with string!

Posted: Wed May 14, 2014 7:40 pm
by FourthWorld
Excel is a complex proprietary format. How are you writing to it? Does the method you're using account for any expectations it may have for platform-specific line endings?

Re: Strange behaviour with string!SOLVED!

Posted: Wed May 14, 2014 10:36 pm
by wee wullie
Hi, I solved the problem with:

Code: Select all

replace CR with "" in field "comments"
and it works fine.

I really should have thought about that one before I posted but many thanks anyway.