Strange behaviour with string!

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
wee wullie
Posts: 78
Joined: Fri Oct 03, 2008 10:13 am

Strange behaviour with string!

Post by wee wullie » Wed May 14, 2014 5:43 pm

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

robertem
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 25
Joined: Tue Mar 19, 2013 2:58 pm

Re: Strange behaviour with string!

Post by robertem » Wed May 14, 2014 7:13 pm

I have not seen this while working with strings, do you have some code that demonstrates the problem?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Strange behaviour with string!

Post by FourthWorld » Wed May 14, 2014 7:40 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

wee wullie
Posts: 78
Joined: Fri Oct 03, 2008 10:13 am

Re: Strange behaviour with string!SOLVED!

Post by wee wullie » Wed May 14, 2014 10:36 pm

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.

Post Reply