Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!src.honeywell.com!msi.umn.edu!cs.umn.edu!kksys!edgar!mmug!f13.n396.z1.mmug.edgar.mn.org!Edward.Blakes.Jr. From: Edward.Blakes.Jr.@f13.n396.z1.mmug.edgar.mn.org (Edward Blakes Jr.) Newsgroups: comp.sys.mac.programmer Subject: ?'s about HC 2.0 XCMD Text Edit stuff Message-ID: <4.27CF2777@mmug.edgar.mn.org> Date: 1 Mar 91 14:03:00 GMT Sender: ufgate@mmug.edgar.mn.org (newsout1.26) Organization: FidoNet node 1:396/13 - New Orleans MUG, New Orleans LA Lines: 53 I'm trying to be able to "cut and paste" lines between fields in HC 2.0. I'm writing an XCMD to do it. Whenever I try to call TECopy(), GetStylHandle(), or really anything that fools with the TE scrap, HC goes kablooey (sp?) and "unexpectedly quits (1)". Below is an excerpt of the code. I'm using Think C 4.0.2. Am I doing something wrong? Am I not allowed to put something in the scrap areas in Hypercard or perhaps as a code resource? I wish I could phrase better questions but I don't know what to ask. Also, does GetFieldTE() return a copy of the TE record or a copy of the handle to the field's TE record? Any input would be appreciated. Ed Blakes blakes@rex.cs.tulane.edu ******** Here's the code ********************************** /* other declarations, etc. */ TEHandle fieldTE, toTE; /* TE record of field */ Handle htxt; /* Handle to text */ StScrpHandle txt_scrap; /* Handle to text style scrap */ TEHandle tempTE; /* TE handle to temp area for pasting */ /* Get params stuff. Nothing fishy here */ /* Get fieldTE of FROM field and TO field */ fieldTE = GetFieldTE(paramPtr, TRUE, fromID, 0, NIL); toTE = GetFieldTE(paramPtr,TRUE,toID,0,NIL); /* Select the entire toTE and paste it to a temp TErec */ TESetSelect(0,32767,toTE); /*** HC dies right here ***/ TECopy (toTE); TEStylPaste(tempTE); TESetSelect(1,20,fieldTE); htxt = TEGetText(fieldTE); txt_scrap = GetStylScrap(fieldTE); TESetSelect(0,0,tempTE); HLock(htxt); TEStylInsert(*htxt,19,txt_scrap,tempTE); HUnlock(htxt); SetFieldTE(paramPtr,TRUE,toID,0,NIL,tempTE); /* Dispose of TEHandle */ etc. --- -- Edward Blakes Jr. - via The Minnesota Macintosh Users Group UUCP-Fido Gateway UUCP: ...jhereg!kksys!vware!edgar!mmug!396!13!Edward.Blakes.Jr. INET: Edward.Blakes.Jr.@f13.n396.z1.mmug.edgar.mn.org