Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!dali.cs.montana.edu!rpi!uupsi!sunic!liuida!slaka!micke From: micke@slaka.sirius.se (Mikael Karlsson) Newsgroups: comp.sys.amiga.tech Subject: Re: Can we salvage the clipboard? Message-ID: <74005.AA74005@slaka.sirius.se> Date: 11 Jun 90 13:45:01 GMT Followup-To: comp.sys.amiga.tech Lines: 74 Expires: Keywords: In message <8886@wehi.dn.mu.oz>, BAXTER_A@wehi.dn.mu.oz writes: [Mild flaming here] >Has anyone out there actually tried to program the clipboard?? Yep, I sure did. I dare say that I've "heightened the awareness" of the clipboard. >I wrote the copy stuff, chacked all my variables, and the text string >before it went in and everything. All looked fine. > >Then I tried to find a bug free program that could show me what was in >there. _Bug free_!! I must have been out of my mind!!! I'm beginning to suspect... >Notepad: This must be close to the slowest implementation of a clip >board in the world. I guess I can agree on that. >Snap: Probably worse. Seems to use a static buffer for text of about >250 chars. Once that is full, no dice. Here I don't agree. If anyone else has had this kind of problems, please let me know. Except if you're trying to paste into the CLI. I guess you do know that the input line is limited. >I ended up writing my own viewer. Just a little function to spew the >contents out into the current cli. The clip was in there ok, and the >copy and paste functions are reasonably fast. It just looks like there >is almost no support for the clipboard in the world-at-large. A sad truth. >2) The latest source to snap, and I'll add dynamic memory allocation >so we can snap any amount of text (which I can send in return, if desired). Actually, I feel quite offended by this. You simply assume that I'm too stupid to handle something like this. Please don't do that. I am able to write some dynamic memory allocation routines, thank you. I can show you the important lines of FetchClip() right here: (VOID)ReadClip(ClipReq, (STRPTR)&ID, 5L, CLIP_CONT); /* #chars */ temp = ID[0]; Snap = AllocMem((LONG)sizeof(struct Snap)+temp, MEMF_PUBLIC|MEMF_CLEAR); Snap->Size = sizeof(struct Snap)+temp; ReadClip(ClipReq, (STRPTR)&Snap->Chars[0], Snap->Size+1L, CLIP_LAST); (Yes, I have added checking for AllocMem() failure, but I didn't think that would be necessary to show here.) If you have any other ideas about things you would like to see in Snap, just send them to me, perhaps including some code on how to do it, and I'll see what I can do. >An suggestions for salvaging the clipboard??? Write some good code, make that available, and try to be a bit more polite about it. >Regards Alan /Mikael -- \_/ Mikael Karlsson, Lovsattersvagen 10, S-585 98 LINKOPING, SWEDEN V | micke@slaka.sirius.se | Absolut Software | micke@slaka.UUCP ~~~ | {mcvax,seismo}!sunic!liuida!slaka!micke