At 9:48 AM -0600 on 3/25/00, Jay Reeve wrote: >Hello Brian, > > >Based on a FN called "createTextFile" by Al Staffieri Jr, I derived >>this to deal with the styl resource. I 'sort of' understand what >>he's doing here to save the "styl" resource. With FN NEWHANDLE, do I > >have to call dispose handle? >I think so, but someone more used to working with resources should >confirm that. I looked up FN NEWHANDLE in IM. I don't need dispose of the handle, at least IM doesn't mention it. What confused me was the example I found on the euro site. It disposes of a handle. This is for 'GET FIELD', the reference manual mentions doing this to the 'ZTXT' handle. > >The thing I can't figure out is how do I get the handle to just the >>text portion? I don't want to save this as a "ZTXT" resource. > >Try this: >efH& = TEHANDLE(efID) >txtHndl& = efH&..teTextH& >'This gives you the handle used by the edit field. >'To make your own copy of that handle block, use this: >txtHndl& = FN HAND2HAND(efH&..teTextH&) >> I couldn't get this to work. After looking closer at the example I found, I missed that he used FN NEWHANDLE then BLOCKMOVE to move the 'styl' info _only_ to the new block. I figured this would work if I just got the 'TEXT' info from the same block. This worked just as I wanted: (It feels good to figure these things out) LOCAL FN createTextResource (efNum)' for save operations (text and style to resource of my app) DIM @editHndl& DIM textSize& DIM fullSize& DIM styleSize& DIM textHndl& DIM styleHndl& GET FIELD editHndl&, efNum textSize& = PEEK WORD ([editHndl&]) ' length of text fullSize& = FN GETHANDLESIZE (editHndl&) ' length of text + style styleSize& = fullSize& - textSize& ' length of style info styleHndl& = FN NEWHANDLE (styleSize&) BLOCKMOVE [editHndl&] + textSize& + 2, [styleHndl&], styleSize& textHndl& = FN NEWHANDLE (textSize&) BLOCKMOVE [editHndl&] + 2, [textHndl&], textSize& FN pGreplaceRes(styleHndl&,_"styl",1000,"New Subject") FN pGreplaceRes(textHndl&,_"TEXT",1000,"New Subject") DEF DISPOSEH (editHndl&) END FN (If anyone reading this, please feel free to point out errors or suggestions) Thanks, Brian Hughes