Dart Home | PowerTCP Emulation for ActiveX | Custom Development | Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums |
Author | Forum: PowerTCP Emulation / Telnet for ActiveX Topic: Copy/Paste and VT/Telnet components in Delphi |
The Master From: Green Bay, WI USA Posts: 48 Member Since: 02/07/01 |
posted January 19, 2006 2:32 PM We're been using the VT/Telnet tools for our internal terminal emulator for the last couple of years. We've been puzzled by a funny bug in coding copy/paste support into our Delphi-based app, and I'm looking for any insight anyone might have into why this doesn't work: If we paste the following text into the terminal, using this code: //Paste Clipboard text directly to Telnet Send if Clipboard.HasFormat(CF_TEXT) then begin data := Clipboard.AsText; Telnet1.Send(data,Length(data)); end Here's the text: for each recv-hist no-lock break by recv-hist.in-rcvng by recv-hist.vendor-nbr: export chr(160) + recv-hist.item + chr(160) recv-hist.desc recv-hist.vendor-nbr recv-hist.name (if recv-hist.eta-dt <> ? then string(recv-hist.eta-dt) else "") recv-hist.on-ordr recv-hist.in-rcvng. end. Here's the text after pasting into the buffer: for each recv-hist no-lock break by recv-hist.in-rcvng by recv-hist.vendor-nbr: export chr(160) + recv-hist.item + chr(160) recv-hist.desc recv-hist.vendor-nbr recv-hist.name (if recv-hist.eta-dt <> ? then string(recv-hist.eta-dt) else "") recv-hist.on-ordr recv-hist.in-rcvng. end. As you can see, the text is sliding over by 4 characters after every line as added. We've tried stripping line feeds (since the enter key is sent as #13, not #13#10), and we've tried pausing between each individual character to try to avoid speed issues, but no matter what we've tried, this is what happens with that text. Any ideas? I'm totally baffled at this point. Keith |
The Master From: Green Bay, WI USA Posts: 48 Member Since: 02/07/01 |
posted January 19, 2006 2:33 PM I should note that the text sent has no "funny" chars--it's all text, spaces and cr/lf sequences. There's no tabs or other "weirdness" that might cause issues. |
The Master From: Green Bay, WI USA Posts: 48 Member Since: 02/07/01 |
posted January 19, 2006 4:11 PM Never mind. I figured it out. Turns out the UNIX application we're doing out text editing in supports auto-indenting in some situations, but not others. This problem is coming up when you write certain types of text. I should have realized this before plonking down an hour debugging :-/ Keith |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted January 19, 2006 4:14 PM Thanks for following up. I had just started to look at this and was trying to figure out a diplomatic way of saying "Wow that's a weird one" without offering a solution. |
The Master From: Green Bay, WI USA Posts: 48 Member Since: 02/07/01 |
posted January 19, 2006 4:16 PM What sucks is I work in this editor 8 hours + a day, and I should have seen what was happening right away. Instead I wasted a lot of my time and yours because it was so weird. Auto-indent sucks. I need to find a way to shut it off :-) |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted January 19, 2006 4:18 PM I don't use UNIX alot, but I have to say that the auto-indenting the Borland uses in BCB and Delphi drives me crazy. I can never get it to behave the way I want. |
The Master From: Green Bay, WI USA Posts: 48 Member Since: 02/07/01 |
posted January 19, 2006 4:19 PM I use Delphi regularly too. I totally agree :-) |
Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums |
This site is powered by
![]() |