Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!ucsd!rutgers!hsdndev!cmcl2!adm!news From: CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) Newsgroups: comp.lang.pascal Subject: Re:Looking for a cut/paste procedure Message-ID: <25409@adm.brl.mil> Date: 7 Jan 91 11:18:36 GMT Sender: news@adm.brl.mil Lines: 47 In article <950048@hpclapd.HP.COM>, defaria@hpclapd.hp.com (Andy DeFaria) wrote: [...deleted...] >One of the problems that I have is that there can be up to 2000 >characters cut and TP only likes strings < 256 characters. >Another problem is that currently my highlight and cut procedure >isn't smart enough to be able to cut only what is highlighted >and tends to cut the same character(s) multiple times. I know >that given more time, debugging and coding I could work through it >but I would appreciate any pointers (and/or code) to help me >complete this task. Don't cut to a string: cut to an array of char (or byte or word). (Be sure to note that the simplest cut (a Move from screen memory to your array) will pick up the attribute bytes as well as the character bytes.) The array will not be limited to 255 char. When pasting, you will have to consider issues related to blanks at the end of lines (if you are cutting a rectangle from the screen, and some lines in it are shorter than others, like text with a ragged right margin) and implicit carriage returns (when text runs all the way to the right margin), etc. As for the cutting of characters multiple times, I don't think we can really give you a clue where you're going wrong without seeing some code. Perhaps your drag algorithm is off? It seems to me that you should be picking off an upper left corner and a lower right corner (begin and end of the drag), then doing some kind of action that boils down to i := 0; for y := ytl to ylr do for x := xtl to xlr do begin buffer[i] := charAt(x,y); Inc(i); end; (where you've got an appropriate charAt function). +--------------------------------------------------------------------+ | Karl Brendel Centers for Disease Control | | Internet: CDCKAB@EMUVM1.BITNET Epidemiology Program Office | | Bitnet: CDCKAB@EMUVM1 Atlanta, GA, USA | | Home of Epi Info 5.0 | +--------------------------------------------------------------------+