Re: AW: Different result in LC 6 to LC 8 when copying field text into Excel?

2017-02-08 Thread Mark Waddingham via use-livecode
They are platform-specific - the 'original' win32 ones are here:



It looks like Tiemo has discovered a bug in the docs!

Warmest Regards,

Mark.

Sent from my iPhone

> On 8 Feb 2017, at 16:17, Richard Gaskin via use-livecode 
>  wrote:
> 
> Tiemo Hollmann wrote:
> 
> > I tested a little bit more and this code works for me:
> > on mouseUp
> >lock clipboard
> >set the rawClipBoardData to empty
> >set the rawClipboardData["CF_UNICODETEXT"] to textEncode(fld 1, "UTF-16" 
> > )
> >unlock clipboard
> > end mouseUp
> >
> > and the IDE doesn't crashes anymore.
> > BTW. The rawclipboarddata key is supposed to be ["CF_UNICODETEXT"]
> > and not ["CF_UNICODE"] as the docs say.
> 
> I wonder if the difference in keys is because the keys of the 
> rawClipboardData are platform-specific.
> 
> After reading Mark Waddingham's note here last week on a related subject:
> http://lists.runrev.com/pipermail/use-livecode/2017-February/234491.html
> 
> ...I've come to regard the fullClipboardData as my go-to first choice for 
> manipulating Clipboard contents, resorting to rawClipboardData only when I 
> need some platform-specific special handling I can't address with 
> fullClipboardData.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: AW: Different result in LC 6 to LC 8 when copying field text into Excel?

2017-02-08 Thread Richard Gaskin via use-livecode

Tiemo Hollmann wrote:

> I tested a little bit more and this code works for me:
> on mouseUp
>lock clipboard
>set the rawClipBoardData to empty
>set the rawClipboardData["CF_UNICODETEXT"] to textEncode(fld 1, 
"UTF-16" )

>unlock clipboard
> end mouseUp
>
> and the IDE doesn't crashes anymore.
> BTW. The rawclipboarddata key is supposed to be ["CF_UNICODETEXT"]
> and not ["CF_UNICODE"] as the docs say.

I wonder if the difference in keys is because the keys of the 
rawClipboardData are platform-specific.


After reading Mark Waddingham's note here last week on a related subject:
http://lists.runrev.com/pipermail/use-livecode/2017-February/234491.html

...I've come to regard the fullClipboardData as my go-to first choice 
for manipulating Clipboard contents, resorting to rawClipboardData only 
when I need some platform-specific special handling I can't address with 
fullClipboardData.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


AW: Different result in LC 6 to LC 8 when copying field text into Excel?

2017-02-08 Thread Tiemo Hollmann TB via use-livecode
Paul,
I tested a little bit more and this code works for me:
on mouseUp
   lock clipboard
   set the rawClipBoardData to empty
   set the rawClipboardData["CF_UNICODETEXT"] to textEncode(fld 1, "UTF-16" )
   unlock clipboard
end mouseUp

and the IDE doesn't crashes anymore.
BTW. The rawclipboarddata key is supposed to be ["CF_UNICODETEXT"] and not 
["CF_UNICODE"] as the docs say.

Thanks for your help
Tiemo


-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag von 
Tiemo Hollmann TB via use-livecode
Gesendet: Mittwoch, 8. Februar 2017 09:33
An: 'How to use LiveCode' 
Cc: Tiemo Hollmann TB 
Betreff: AW: Different result in LC 6 to LC 8 when copying field text into 
Excel?

Hi Paul,

I test your approach, but when running the code in the DIE, LiveCode crashes 
immediatly. When debugging the code, it doesn't crashes, but stops at setting 
the rawclipboarddata with an error "clipboard is not locked".
This happens anyhow, if I am using "lock clipboard" or not.  I'll file it Tiemo

-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag von 
Paul Hibbert via use-livecode
Gesendet: Dienstag, 7. Februar 2017 22:11
An: How to use LiveCode 
Cc: Paul Hibbert 
Betreff: Re: Different result in LC 6 to LC 8 when copying field text into 
Excel?

Tiemo,

I’m not sure if this will help because I’m testing on Mac, but I did a little 
bit of experimenting with the new ‘rawClipboardData’, it allows plain text to 
be copied out of LC, just to prove it, here’s a button script copied via my now 
modified Script Buddy plugin…

on mouseUp
   local tClip

   if the selectedText is empty then
  set the clipBoardData["text"] to fld “myTextField"
   else
  copy the selectedText
   end if
   
   if the altKey is down then -- Convert the clipBoard to plain text
  put the clipBoardData["text"] into tClip
  lock the clipBoard
  ## Use some code lifted from the LiveCode Dictionary…
  set the rawClipBoardData to empty -- Clear ALL ClipboardData
  if the platform is "Linux" then set the 
rawClipboardData["text/plain;charset=utf-8"] \
to textEncode(tClip, "UTF-8" ) -- Linux
  if the platform is "Win32" then set the rawClipboardData["CF_UNICODE"] \
to textEncode(tClip, "UTF-16" ) -- Windows
  if the platform is "MacOS" then set the 
rawClipboardData["public.utf8-plain-text"] \
to textEncode(tClip, "UTF-8" ) -- OSX
  unlock the clipboard
   end if
end mouseUp

At last, no extra line spacing! :-)

Normally when I paste from LC into Mail I see extra line spacing, and I would 
have to copy and paste via a plain text editor to remove it. Emptying the 
clipBoard and setting the rawClipboardData as above seems to work, on Mac at 
least, hopefully it should work with Excel on Windows too.

Paul




> On Feb 3, 2017, at 6:25 AM, Tiemo Hollmann TB via use-livecode 
>  wrote:
> 
> Can anybody on Windows with LC 8 confirm this:
> 
> - create a new stack
> - create a scrolling list field
> - enter three lines of text, each with one word
> - enter into the message box: *set the clipboarddata["text"] to fld 1*
> - open MS Excel (in my case Windows 10, Excel 2013)
> - paste
> - see an extra empty line between each line of text
> 
> Pasted in a text editor there are no extra lines and up to LC 7 there 
> also was no extra line in Excel.
> 
> Can anybody confirm this behavior or even has an idea for a workaround?
> 
> Thanks
> Tiemo
> 
> 
> 
> -Ursprüngliche Nachricht-
> Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im 
> Auftrag von Tiemo Hollmann TB via use-livecode
> Gesendet: Donnerstag, 2. Februar 2017 12:13
> An: LiveCode User Liste senden 
> Cc: Tiemo Hollmann TB 
> Betreff: Different result in LC 6 to LC 8 when copying field text into 
> Excel?
> 
> Hello,
> 
> I have a standard scrolling list field with multiple lines of text. I 
> copy the text by:
> 
> *set the clipboarddata["text"] to fld "List"*
> 
> The User now can past the text into MS Excel on Windows. With LC 6 the 
> text was pasted into Excel line by line, as it showed up in LC. In LC
> 8.1.2 the text is pasted with an extra space line between each two lines.
> 
> I checked the line ends in both versions. There is only one "LF"
> (byteToNum=10) at the end of each line and it looks the same in both 
> versions.
> 
> What has changed in LC 8 to cause such a different behavior? Is this 
> again a Unicode thing what I don't understand? I already tried 
> different clipboarddata keys, w

AW: Different result in LC 6 to LC 8 when copying field text into Excel?

2017-02-08 Thread Tiemo Hollmann TB via use-livecode
Hi Paul,

I test your approach, but when running the code in the DIE, LiveCode crashes 
immediatly. When debugging the code, it doesn't crashes, but stops at setting 
the rawclipboarddata with an error "clipboard is not locked".
This happens anyhow, if I am using "lock clipboard" or not.  I'll file it
Tiemo

-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag von 
Paul Hibbert via use-livecode
Gesendet: Dienstag, 7. Februar 2017 22:11
An: How to use LiveCode 
Cc: Paul Hibbert 
Betreff: Re: Different result in LC 6 to LC 8 when copying field text into 
Excel?

Tiemo,

I’m not sure if this will help because I’m testing on Mac, but I did a little 
bit of experimenting with the new ‘rawClipboardData’, it allows plain text to 
be copied out of LC, just to prove it, here’s a button script copied via my now 
modified Script Buddy plugin…

on mouseUp
   local tClip

   if the selectedText is empty then
  set the clipBoardData["text"] to fld “myTextField"
   else
  copy the selectedText
   end if
   
   if the altKey is down then -- Convert the clipBoard to plain text
  put the clipBoardData["text"] into tClip
  lock the clipBoard
  ## Use some code lifted from the LiveCode Dictionary…
  set the rawClipBoardData to empty -- Clear ALL ClipboardData
  if the platform is "Linux" then set the 
rawClipboardData["text/plain;charset=utf-8"] \
to textEncode(tClip, "UTF-8" ) -- Linux
  if the platform is "Win32" then set the rawClipboardData["CF_UNICODE"] \
to textEncode(tClip, "UTF-16" ) -- Windows
  if the platform is "MacOS" then set the 
rawClipboardData["public.utf8-plain-text"] \
to textEncode(tClip, "UTF-8" ) -- OSX
  unlock the clipboard
   end if
end mouseUp

At last, no extra line spacing! :-)

Normally when I paste from LC into Mail I see extra line spacing, and I would 
have to copy and paste via a plain text editor to remove it. Emptying the 
clipBoard and setting the rawClipboardData as above seems to work, on Mac at 
least, hopefully it should work with Excel on Windows too.

Paul




> On Feb 3, 2017, at 6:25 AM, Tiemo Hollmann TB via use-livecode 
>  wrote:
> 
> Can anybody on Windows with LC 8 confirm this:
> 
> - create a new stack
> - create a scrolling list field
> - enter three lines of text, each with one word
> - enter into the message box: *set the clipboarddata["text"] to fld 1*
> - open MS Excel (in my case Windows 10, Excel 2013)
> - paste
> - see an extra empty line between each line of text
> 
> Pasted in a text editor there are no extra lines and up to LC 7 there 
> also was no extra line in Excel.
> 
> Can anybody confirm this behavior or even has an idea for a workaround?
> 
> Thanks
> Tiemo
> 
> 
> 
> -Ursprüngliche Nachricht-
> Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im 
> Auftrag von Tiemo Hollmann TB via use-livecode
> Gesendet: Donnerstag, 2. Februar 2017 12:13
> An: LiveCode User Liste senden 
> Cc: Tiemo Hollmann TB 
> Betreff: Different result in LC 6 to LC 8 when copying field text into 
> Excel?
> 
> Hello,
> 
> I have a standard scrolling list field with multiple lines of text. I 
> copy the text by:
> 
> *set the clipboarddata["text"] to fld "List"*
> 
> The User now can past the text into MS Excel on Windows. With LC 6 the 
> text was pasted into Excel line by line, as it showed up in LC. In LC 
> 8.1.2 the text is pasted with an extra space line between each two lines.
> 
> I checked the line ends in both versions. There is only one "LF"
> (byteToNum=10) at the end of each line and it looks the same in both 
> versions.
> 
> What has changed in LC 8 to cause such a different behavior? Is this 
> again a Unicode thing what I don't understand? I already tried 
> different clipboarddata keys, without success.
> 
> It can't be an Excel option, because I tested it with the same Excel 
> version on the same machine.
> 
> Any idea, what has to be changed to get the same clipboard result as 
> in LC 6?
> 
> Thank you
> 
> Tiemo
> 
> 
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please vi

AW: Different result in LC 6 to LC 8 when copying field text into Excel?

2017-02-03 Thread Tiemo Hollmann TB via use-livecode
the headquarter could confirm this interaction to Excel bug and pointed me
to the workaround with "paste special as text"
Tiemo 

-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag
von Tiemo Hollmann TB via use-livecode
Gesendet: Freitag, 3. Februar 2017 15:26
An: 'How to use LiveCode' 
Cc: Tiemo Hollmann TB 
Betreff: AW: Different result in LC 6 to LC 8 when copying field text into
Excel?

Can anybody on Windows with LC 8 confirm this:

- create a new stack
- create a scrolling list field
- enter three lines of text, each with one word
- enter into the message box: *set the clipboarddata["text"] to fld 1*
- open MS Excel (in my case Windows 10, Excel 2013)
- paste
- see an extra empty line between each line of text

Pasted in a text editor there are no extra lines and up to LC 7 there also
was no extra line in Excel.

Can anybody confirm this behavior or even has an idea for a workaround?

Thanks
Tiemo



-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag
von Tiemo Hollmann TB via use-livecode
Gesendet: Donnerstag, 2. Februar 2017 12:13
An: LiveCode User Liste senden 
Cc: Tiemo Hollmann TB 
Betreff: Different result in LC 6 to LC 8 when copying field text into
Excel?

Hello,

I have a standard scrolling list field with multiple lines of text. I copy
the text by:

*set the clipboarddata["text"] to fld "List"*

The User now can past the text into MS Excel on Windows. With LC 6 the text
was pasted into Excel line by line, as it showed up in LC. In LC 8.1.2 the
text is pasted with an extra space line between each two lines.

I checked the line ends in both versions. There is only one "LF"
(byteToNum=10) at the end of each line and it looks the same in both
versions.

What has changed in LC 8 to cause such a different behavior? Is this again a
Unicode thing what I don't understand? I already tried different
clipboarddata keys, without success.

It can't be an Excel option, because I tested it with the same Excel version
on the same machine.

Any idea, what has to be changed to get the same clipboard result as in LC
6?

Thank you

Tiemo

 

 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


AW: Different result in LC 6 to LC 8 when copying field text into Excel?

2017-02-03 Thread Tiemo Hollmann TB via use-livecode
Can anybody on Windows with LC 8 confirm this:

- create a new stack
- create a scrolling list field
- enter three lines of text, each with one word
- enter into the message box: *set the clipboarddata["text"] to fld 1*
- open MS Excel (in my case Windows 10, Excel 2013)
- paste
- see an extra empty line between each line of text

Pasted in a text editor there are no extra lines and up to LC 7 there also
was no extra line in Excel.

Can anybody confirm this behavior or even has an idea for a workaround?

Thanks
Tiemo



-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag
von Tiemo Hollmann TB via use-livecode
Gesendet: Donnerstag, 2. Februar 2017 12:13
An: LiveCode User Liste senden 
Cc: Tiemo Hollmann TB 
Betreff: Different result in LC 6 to LC 8 when copying field text into
Excel?

Hello,

I have a standard scrolling list field with multiple lines of text. I copy
the text by:

*set the clipboarddata["text"] to fld "List"*

The User now can past the text into MS Excel on Windows. With LC 6 the text
was pasted into Excel line by line, as it showed up in LC. In LC 8.1.2 the
text is pasted with an extra space line between each two lines.

I checked the line ends in both versions. There is only one "LF"
(byteToNum=10) at the end of each line and it looks the same in both
versions.

What has changed in LC 8 to cause such a different behavior? Is this again a
Unicode thing what I don't understand? I already tried different
clipboarddata keys, without success.

It can't be an Excel option, because I tested it with the same Excel version
on the same machine.

Any idea, what has to be changed to get the same clipboard result as in LC
6?

Thank you

Tiemo

 

 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode