/* $VER: AutomaticTextFrame.rexx 1.0a (04.12.94) Copyright 1994 Soft-Logik Publishing Corporation May not be distributed without Soft-Logik Publishing Corporation's express written permission */ OPTIONS RESULTS TRACE OFF /* Make sure rexx support is opened */ IF ~SHOW('L','rexxsupport.library') THEN CALL ADDLIB('rexxsupport.library',0,-30) ADDRESS 'PAGESTREAM' /* Check and see if a text frame is selected */ 'getcursor type objtype' if RC>0 | objtype='TEXTOBJ' then do allocarexxrequester '"Automatic Text Frame Error!"' 524 51 reqhandle=result addarexxgadget reqhandle EXIT 442 34 70 label "_Exit" Exithandle=result addarexxgadget reqhandle TEXT 8 10 504 border none string "'The insertion point must be in a text frame to use this macro.'" doarexxrequester reqhandle freearexxrequester reqhandle EXIT end /* Find how many frames are in the article, and the current frame's ID */ 'getcursor framestart framecursor' 'getarticle frames fstem' framecount=fstem.count framecursor=framecursor+1 currentframe=fstem.framecursor lastframe=fstem.framecount /* Check that there are no linked frames after the current frame */ if currentframe~=lastframe then do allocarexxrequester '"Automatic Text Frame Error!"' 444 51 reqhandle=result addarexxgadget reqhandle EXIT 362 34 70 label "_Exit" Exithandle=result addarexxgadget reqhandle TEXT 8 10 424 border none string "'There are linked text frames after the current one!.'" doarexxrequester reqhandle freearexxrequester reqhandle EXIT end /* Get Info on the current frame */ 'refresh wait' getcolumn position pstem columns number gutter space rotation rstem about rstem constrain cflag print pflag /* Create the new frame */ pstring=pstem.left' 'pstem.top' 'pstem.right' 'pstem.bottom' skew 'rstem.slant' 'rstem.twist' columns 'number' gutter 'space if rstem.mode=POINT then pstring=pstring' about 'rstem.x' 'rstem.y if cflag=ON then pstring=pstring' constrain' if pflag=OFF then pstring=pstring' noprint' getdisplay dstem display page dstem.page+1 'drawcolumn 'pstring newframe=result /* Link the frames */ 'settextrouting from objectid 'currentframe' to objectid 'newframe 'refresh continue'