A guess:
After playing with it, it looks like memory is being overwritten, as in a buffer overflow. I would try changing the SetClipboardData function to pass a bank instead of a string.
1) In the userlib declaration, change txt$ to txt*
2) In WriteClipboardText, convert the string to a bank before sending
See if that works better
After playing with it, it looks like memory is being overwritten, as in a buffer overflow. I would try changing the SetClipboardData function to pass a bank instead of a string.
1) In the userlib declaration, change txt$ to txt*
2) In WriteClipboardText, convert the string to a bank before sending
See if that works better